2
我試圖跟隨角2 DOC與角2路由的在-depht理解:https://angular.io/docs/ts/latest/guide/router.html#!#route-config角2路由器+角CLI
當我嘗試重定向爲默認頁解釋的那樣,打字稿編譯器給我這個錯誤:
Type '{ path: string; redirectTo: string; pathMatch: string; }' is not assignable to type 'Route'.
Object literal may only specify known properties, and 'pathMatch' does not exist in type 'Route'.
這裏是我的代碼:
export const CrisisCenterRoutes: RouterConfig = [
{
path: '',
redirectTo: '/crisis-center',
pathMatch: 'full'
},
{
path: 'crisis-center',
component: CrisisCenterComponent,
children: [
{ path: ':id', component: CrisisDetailComponent },
{ path: '', component: CrisisListComponent }
]
},
{
path: 'admin',
component: CrisisAdminComponent
},
];
我找不到這個明顯的問題作出任何解釋。代碼編譯時,我刪除'pathMatch'屬性。
非常感謝您的解釋。
非常感謝我要瘋了;) – Valentin
認真...從3.0.0-alpha.8更新到beta.2 ... UGH(intellij生成的模板) – Neikius