I have the following tab bar links and the first one is supposed to be empty:
<nav md-tab-nav-bar>
<a md-tab-link [routerLink]="'./'"
routerLinkActive #rla="routerLinkActive" [active]="rla.isActive">
My tab
</a>
...
</nav>
The link works fine but the active state is not triggered.
What is the proper way to handle empty routerlink for the tab to be activated?
Try this instead
<a [routerLink]=" ['./'] "
routerLinkActive="active" [routerLinkActiveOptions]= "{exact: true}">
My tab
</a>
https://angular.io/docs/ts/latest/api/router/index/RouterLinkActive-directive.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With