I'm using the following template statement to determine the class of a tab element:
<li [class.active]="router.url == '/member-view/member-profile/' + routeParamVar">
The class should be active regardless of what the route parameter is. But ideally I can drop the specific route param into the Router.url statement. This is the first part of this question and it seems fairly straight forward, but I'm not sure how to do it.
A complication, I believe, is that this element is in the parent template of the view with the actual route param. It doesn't seem like I'm able to assign the ActivatedRoute param to a variable in the component like this:
this.uid = this.activeRoute.snapshot.params['uid']
I've messed around with using a service or @ViewChild to get the uid from the child to the parent, but haven't quite figured it out yet. So in summary my question is twofold:
First, how can I assign the route param of a child component to a variable in the parent component?
Second, how might I get that variable into the Router.url in the template statement?