angular2 rc3 路由器 alpha 3.0.0.7 默认路由

angular2 rc3 router alpha 3.0.0.7 default route

angular2 rc3...使用新路由器(alpha 3.0.0-alpha.7),如何指定默认路由? useAsDefault 是旧路由器...并且“*”似乎不起作用。

这应该清楚我想要什么...我无法使 "NotFoundComponent" 部分正常工作。

export const routes: RouterConfig = [
    { path: 'abc', component: AbcComponent },
    { path: 'def', component: DefComponent },
    { path: '', component: HomeComponent },
    { path: '*', component: NotFoundComponent }  // something like this
];

谢谢!

我觉得应该是

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

这里是doc

顺便说一句,

如果你想设置root为默认路由,有一个方法。

设置 pathMatch = 'full' 并设置 redirectTo 值

[
  {
    path: '',
    pathMatch: 'full',
    redirectTo: 'teams'
  },
  {
    path: 'teams',
    component: TeamsComponent
  }
]

这是 blog post 谈论这个