I use a tab-nav-bar. my tabs are created correctly. When I click on one tab, the route works, and the tab become active correctly.
My problem is when I first load the website, the root tab has the ink as expected, but the label is not in active mode
- On top: on loading, the label "home" is grayed out (my problem)
- On bottom: after a click on the tab, the label "home" is full white (as it should be on loading).
- Note: the route is the same in both case "/home"
component:
export class NavbarComponent {
// List of links
links = [
{label: 'Home', path:'/home'},
{label: 'Design', path:'/design'}
];
constructor() { }
template:
<nav mat-tab-nav-bar
class="mat-elevation-z4"
backgroundColor="primary">
<a *ngFor="let link of links"
#rla="routerLinkActive"
mat-tab-link
routerLinkActive
[routerLink]="link.path"
[routerLinkActiveOptions]="{exact: true}"
[active]="rla.isActive">
{{link.label}}
</a>
</nav>
