在angular2 RC-4中使用子路由时出现此错误
无法读取未定义的属性“ pathsWithParams”
我的路由文件包含
export const routes: RouterConfig = [
{ path: '', component: HomeComponent },
{ path: 'demo', component: DummyComponent },
{ path: 'user-profile', component: UserProfileComponent,
children:[
{ path: '', component: ProfileOverview },
{ path: 'smart-points', component: ProfileSmartPoints }
]},
]
任何想法 ?
每当我routerLinkActive
在html端使用时,问题就出在问题上
得到了答案谢谢@micronyks
其实万阿英,蒋达清是我们必须使用的财产[routerLinkActiveOptions]="{exact: true}"
在使用routerLinkActive="active-link"
的HTML检查活动路线。
所以正确的语法是:
<a routerLinkActive="active" [routerLinkActiveOptions]="{exact:true}" [routerLink]='["./Dummy"]'>Dummy</a>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句