0
此代碼生成的鏈接像routerLinkActive匹配的路由參數
屈指可數/報道
/報告?收集= foo的
/報告?收集=酒吧
所有鏈接顯示爲活動。我如何只顯示一個確切的鏈接爲活動?
<li [routerLinkActive]="['link-active']" [routerLinkActiveOptions]="{exact: true}">
<a [routerLink]="['/reports']">
<span class='glyphicon glyphicon-expand'></span> Reports
</a>
</li>
<li [routerLinkActive]="['link-active']" [routerLinkActiveOptions]="{exact: true}" *ngFor="let collection of collections">
<a [routerLink]="['/reports']" [queryParams]="{collection: collection}">
<span class='glyphicon glyphicon-unchecked'></span><span>{{collection}}</span>
</a>
</li>