I have already add routing to my angular project. And it is working fine. But I have a issue with router active status.
I use router link to link the router and add router active to find the activated router.
I use bootstrap default nav bar in my project.And I add drop down to nav bar as follow.
<li class="nav-item dropdown" routerActive="active">
<a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown link
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item" routerLink="/link-one">Link One</a>
<a class="dropdown-item" routerLink="/link-two">Link Two</a>
<a class="dropdown-item" routerLink="/link-three">Link Three</a>
</div>
</li>
But When user click router links router active is not working. This issue is only for dropdown but in single nav bar item works perfectly.
What is the issue with this?
routerActivein wrong place also you should be usingngClasshere since the active class is to be added to a different element thanrouterLink