Javascript Angular 2路由器+Angular cli
我试图遵循Angular 2文档,深入了解Angular 2的布线: 当我尝试按说明重定向到默认页面时,typescript编译器会向我发送以下错误:Javascript Angular 2路由器+Angular cli,javascript,angular,Javascript,Angular,我试图遵循Angular 2文档,深入了解Angular 2的布线: 当我尝试按说明重定向到默认页面时,typescript编译器会向我发送以下错误: Type '{ path: string; redirectTo: string; pathMatch: string; }' is not assignable to type 'Route'. Object literal may only specify known properties, and 'pathMatch' d
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”属性时,代码将编译
非常感谢您的解释。您的版本稍旧一些。使用@angular/路由器版本应该是3.0.0-beta.2非常感谢,我快疯了;认真地从3.0.0-alpha.8更新到beta.2。。。生成的模板