How to use relativeTo property in html template along with routerActive?

I need to use relativeTo property as well as routerLinkActive directive in my application. Having a click listener function that routes using

router.navigate(this.router.navigate(['path']{relativeTo:this.route});

      

will be good. But in this case, I cannot use the routerLinkActive directive.

How can I use both at the same time?

+3


source to share


1 answer


RelativeTo defaults to the currently activated route. In a template, you can use '.' or '^' in the route name.



More on relative navigation: fooobar.com/questions/196064 / ... https://angular.io/guide/router#relative-navigation

+1


source







All Articles