My Angular 5路线包含错误;我无法弄清楚是什么。见下文:
到目前为止一切正常。 现在,我直接将浏览器的URL设置为/ secure / admin / users。我希望看到用户管理页面。然而,我按照" redirectTo"重定向。声明(在这种情况下为仪表板)。
我的路线有什么明显的错误吗?提前谢谢。
const appRoutes: Routes = [
{ path: '', component: LoginComponent,
data: { },
canActivate: [AuthAutoRedirectService]
},
{ path: 'secure', component: WrapperComponent,
data: { },
canActivate: [AuthGuardService],
children: [
{ path: '', pathMatch: 'full', redirectTo: 'dashboard'},
{ path: 'dashboard', component: DashboardComponent, data: {}, canActivate: [] },
{ path: 'admin', data: { roles: [] }, canActivate: [AuthGuardService], children: [
{ path: 'users', data: {}, canActivate: [], children: [
{ path: '', pathMatch: 'full', component: AdminUserComponent },
{ path: 'add-user', component: AddUserComponent }
]},
]}
]
}
];