Is there a way to keep the navbar active even after refreshing the page in Angular 2? I am currently using CSS to accomplish this, but the active tab is removed upon page refresh. Any suggestions on how to tackle this?
HTML:--
<ul class="nav navbar-nav navbar-top "
*ngFor="let menu of menus">
<li><a href="" (click)="goToPage($event)">{{menu}}
</a>
</li>
</ul>
css:--
.navigation a:focus {
box-shadow: 0 -5px 0 -4px #eee;
color: #ffffff;
width:30%
}
.navigation a:hover {
box-shadow: 0 -5px 0 -4px #eee;
color: #ffffff;
width:30%
}