-1

I have such navbar with such items : Users, Categories, Products, etc. Their routes are Main/Users, Main/Categories. I have highlited items with routerLinkActive, but i also want to highlight Users, when route is

Main/User?UserId=4

How can i achieve this? Thanks in advance

  • Does this answer your question? [How to use "routerLinkActive" with query params in Angular 6?](https://stackoverflow.com/questions/52037979/how-to-use-routerlinkactive-with-query-params-in-angular-6) – Tal Ohana Aug 06 '21 at 07:13
  • Will it work, because Main/Users and Main/User?UserId=4 are completly different routes? – Vladyslav Aug 06 '21 at 07:18

1 Answers1

1

queryParams is another input of routerLink where they can be passed like follows

<a [routerLink]="['Main/User']" [queryParams]="{UserId: 2}"></a>