具有站点迁移的Angular2路由器

时间:2016-08-21 06:18:53

标签: angular

我正在使用RC5和"@angular/router": "3.0.0-rc.1"而我似乎无法捕捉旧路线(示例):

/category/subcategory/subcategory/articlename

即使使用默认" pathMatch" appRoutes中的参数。这是我的路线配置的片段:

export const appRoutes: Routes = [
  { path: 's/:q', component: SearchController },
  { path: ':slug', component: ArticleController },
  { path: '', component: HomeController, pathMatch: 'full' },
];

其他路线正常工作,就在我尝试捕捉它们时,所以我可以正确地重定向它们......思考?

1 个答案:

答案 0 :(得分:0)

Catch-all路线将是

{ path: '**', component: HomeController }