I am providing a simple routing example which works well. The only issue is that routerLinkActive is adding class 'baboossa' to whichever link is active. When I go from home to other links as 'about' or 'window' the link gets orange (due to baboossa class), but I can still see home also to be orange. Why now I am having 2 links with added classes from routerLinkActive and class is not getting removed from home?
app.component.html
<ul>
<li><a [routerLink]="''" routerLinkActive="baboossa">Home</a></li>
<li><a [routerLink]="'/about'" routerLinkActive="baboossa">About</a></li>
<li><a [routerLink]="'/window'" routerLinkActive="baboossa">Window</a></li>
</ul>
<router-outlet></router-outlet>
app.module.ts
import { RouterModule } from '@angular/router';
imports: [
RouterModule.forRoot([
{path:'', component: HomeComponent},
{path:'about', component: AboutComponent},
{path:'window', component:WindowComponent}
])
]
styles.css
.baboossa {background:orange;}
Results:
Can someone point out the problem why I am getting 2 orange backgrounds on other active links than baseone (home)?



