我正在使用 Angular 2 的路由功能来开发我的应用程序,它运行得很好,但我不知道如何定义“otherwise”路由。也就是说,如果当前URL与任何“支持”的路由都不对应,则显示一个路由。
以下是我的当前配置示例:
@RouteConfig([
{ path: '/', name: 'Home', component: StoryComponent, useAsDefault: true },
{ path: '/story', name: 'Story', component: StoryComponent },
{ path: '/subscription', name: 'Subscription', component: SubscriptionComponent}
])