【发布时间】:2017-09-27 12:01:33
【问题描述】:
我目前有一些路线
<ul class="">
<li class="">
<a [routerLinkActive]="['active']"
[routerLink]="['/user/traffic/graph']" class="">
Traffic
</a>
</li>
</ul>
路线
const trafficRoutes: Routes = [
{
path: '', component: TrafficComponent, children: [
{ path: '', redirectTo: 'graph' },
{ path: 'graph', component: GraphComponent},
{ path: 'alerts', component: AlertComponent}
]
},
];
当我导航到GraphComponent 时,路由器链接被激活,但是当我导航到AlertComponent 时,它没有激活。
我想激活该路由器链接。即使我导航到AlertComponent
如何实现?
【问题讨论】:
标签: angular typescript angular-router