【发布时间】:2017-02-10 09:26:00
【问题描述】:
我正在模块中设置我的路由,我想设置默认路由但它失败了
这是路由模块
const appRoutes: Routes = [
{ path: 'login', component: LoginComponent, useAsDefault:true }, //returns an error
{
path: 'dash',
redirectTo:"dashboard"
},
{ path: 'reset-password', component: ResetPasswordComponent },
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{ path: '**', component: PageNotFoundComponent }
];
以上返回错误
LoginComponent; useAsD...' is not assignable to type 'Route[]'
可能有什么问题
【问题讨论】:
-
怎么了?你有很好的错误响应;)因为路由器没有
useAsDefault属性,检查它:angular.io/docs/ts/latest/api/router/index/Route-interface.html
标签: angular typescript