I am trying to follow the Angular 2 doc for an in-depht understanding of routing with Angular 2 : https://angular.io/docs/ts/latest/guide/router.html#!#route-config
When I try to redirect as explained to a default page, the typescript compiler send me this error :
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'.
Here is my code :
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
},
];
I can't find any explanation for this obvious issue. The code compiles when I delete the 'pathMatch' property.
Thanks a lot for your explanations.