I am using following code:
<ul class="nav navbar-nav">
<li class=""><a routerLink="/overview" routerLinkActive="active">OVERVIEW</a></li>
<li class=""><a routerLink="/insights" routerLinkActive="active">INSIGHTS</a></li>
</ul>
I want 'overview' to be selected by default. And also, when I click on overview or insights, respective link gets selected(with dark background css class), however, if I click away anywhere withing the application, the selection goes off. It's not retained. How can I retain the selected route's link? I am using modules to lazy load the respective content of selected li.
You can see it in action here: http://recordit.co/8wfPmEvqTs
On load, overview router will be shown, but 'overview' is not selected: https://snag.gy/vQnJKm.jpg
When I click on overview, it will get selected: https://snag.gy/PVyDIA.jpg
Now, if I click anywhere else, for example, below the nav bar, the overview's selection goes off: https://snag.gy/W5f7Pa.jpg
I am using v4.0.0. ("@angular/common": "^4.0.0")