2

I'm creating a sideNav bar and the active button won't highlight. I assume it's because the active route is "/app/carrier-alias" and the routerLink on the button element is "/carrier-alias". Does anybody know any work arounds?

    <button mat-button
        *appAllowedRoles="[adminRole.CARRIER_ALIAS_ADMIN]"
        routerLink="/carrier-alias"
        routerLinkActive="bg-primary"
        [routerLinkActiveOptions]="{exact: false}">
  Carrier Alias
</button>

enter image description here

1 Answers1

3

You dont need using the /, and make sure the class bg-primary is well imported

<button mat-button
        *appAllowedRoles="[adminRole.CARRIER_ALIAS_ADMIN]"
        routerLink="carrier-alias"
        routerLinkActive="bg-primary"
        [routerLinkActiveOptions]="{exact: false}">
  Carrier Alias
</button>
DEV
  • 1,607
  • 6
  • 19