Angular routerLinkActive for multiple paths
You can use a template reference variable to get a reference to the outer routes and then apply the class when they are active. You can either link them to an existing routerLinkActive element or to a hidden one. Here is an example using the hidden method.
<li routerLinkActive="active" [ngClass]="{'active': tasksActive.isActive || settingsActive.isActive }">
<a [routerLink]="['/config']">Configuration</a>
</li>
<a routerLink="/tasks" routerLinkActive #tasksActive="routerLinkActive" style="display: none"></a>
<a routerLink="/entity/settings" routerLinkActive #settingsActive="routerLinkActive" style="display: none"></a>
If you're looking for how to prevent multiple links to gets active, there is a [routerLinkActiveOptions]="{exact: true}"
option :
<a routerLink="/" routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">home</a>