2016-08-05 39 views
1

我想有一個像/父/ /旁邊其他/父母/孩子的動態路線。Angular 2與路由器3.0.0-beta.2:是否有可能在孩子旁邊有通配符?

我想這樣的事情沒有成功:

export const routes: RouterConfig = [ { path: '', component: HomeComponent }, { path: 'parent', component: ParentComponent,canActivate: [ WebpackAsyncRoute ], children: [ { path: ':id', component: 'ParamComponent' }, { path: 'child', component: 'ChildComponent' }, { path: 'anotherchild', component: 'AnotherChildComponent' } ] } ];

+0

你試過了嗎?有什麼問題? –

回答

0

答案是肯定的。問題是我沒有在組件上定義的路由配置上添加:id路徑(因爲我使用的是WebpackAsyncRoute)。所以沒有任何關聯的通配符路徑