Angular2 has a routerLinkActive directive which adds class to the element if the route is active. I want to add a class when route is inactive. Is there a way to do this?
<a routerLink="/user/bob" routerLinkActive #rla="routerLinkActive" [ngClass]="rla.isActive ? 'classIfActive' : 'classIfNotActive'">
</a>
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