I have 以下笨蛋 https://plnkr.co/edit/PHaGNtfa0fPBgET4NEpZ?p=preview,这是行不通的。为了让它发挥作用,我可以评论...
RouterModule.forRoot([
{
path: "",
component: TestComponent,
children: [
// {
// path:"",
// outlet: "other",
// component: TestComponent
// }
]
}
])
如果我不这样做,我就会...
EXCEPTION: Uncaught (in promise): Error: Cannot match any routes. URL Segment: ''
Error: Cannot match any routes. URL Segment: ''
如何添加子路线?
您应该给出不同的路径名,直到您使用pathMatch: 'full'
. Forked https://plnkr.co/edit/6tWj2a1EiZPdeuADWAHk?p=preview.
有关该主题的更多信息,请参阅Angular 路由器:空路径、无组件路由和重定向 http://vsavkin.tumblr.com/post/146722301646/angular-router-empty-paths-componentless-routes.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)