角度2路由器剩余路径

时间:2017-03-12 16:56:23

标签: angular router

我如何匹配这样的路线:

/github/my-project/and/a/long/path

我正在寻找:

/github/:repo/**  

 {
    path: 'github/:repo/*',
    component: Page,
    pathMatch: 'prefix'
},

1 个答案:

答案 0 :(得分:1)

 {
    path: 'github/:repo/**',
    component: Page,
    pathMatch: 'prefix'
 },

 {
    path: 'github/:repo',
    component: Page,
    pathMatch: 'prefix',
    children: { path: '**' component: SomeComponent }
 },