Issue
I have a routerlink in an anchor tag, I want to access the value passed. How can I do it? enter image description here
As you can see in the above screenshot, "bob" is the data is being passed to the component when this anchor tag is clicked, so how can I access this value in the component when it loads? Please note that it is a child component of another component therefore route is not used.
Thank you
Solution
Route should work anyway like this:
constructor(private route: ActivatedRoute){}
ngOnInit() {
const debug = this.route.snapshot.paramMap.get('debug');
}
Answered By - Zerotwelve
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.