Angular: How to determine active route with parameters?
问题 I've read this question about how to determine the active route, but still it's not clear to me how to determine an active route with paramaters? Right now I'm doing it like this: <a [routerLink]="['/Profile/Feed', {username: username}]" [ngClass]="{active: getLinkStyle('/profile/john_doe/feed')}"> Feed for {{username}} </a> And inside my component: getLinkStyle(path:string):boolean { console.log(this._location.path()); // logs: '/profile/john_doe/feed' return this._location.path() === path;