2016-07-08 24 views
2

私は角2とルーティングのインdepht理解するために角度2ドキュメントを追跡しようとしています:https://angular.io/docs/ts/latest/guide/router.html#!#route-config角度2ルータ+角度-CLI

私は、デフォルトのページに説明するようにリダイレクトしようとすると、typescriptですがここで

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'プロパティを削除するとコンパイルされます。

ありがとうございました。

答えて

4

少し古いバージョンです。使用@angular/routerバージョンは3.0.0-beta.2

+0

ありがとう私は狂っていた;) – Valentin

+0

真剣に... 3.0.0-alpha.8からbeta.2 ... UGH(intellij生成テンプレート) – Neikius