I am trying to apply or highlight navigation routes for my menu bar with below code, what i could get is, i could able to highlight the submenu, but could not able to highlight the parent menu bar.
<li class="nav-item dropdown"><a
class="nav-link dropdown-toggle " id="navbarDropdownMenuLink"
data-toggle="dropdown" style="color: white; cursor: pointer;"
[routerLinkActive]="['class1']">Parent</a>
<div class="dropdown-menu dropdown-menu-left"
aria-labelledby="navbarDropdownMenuLink">
<a class="dropdown-item"
[routerLink]="['app-child1']"
[routerLinkActive]="['class1']"
>Child 1</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item"
[routerLink]="['app-child2']"
[routerLinkActive]="['class1']"
>Child 2</a>
</div>
</li>
Css class:
.class1{
background-color: #007bff;
}
class1
class? – Z