Angular 5 EmptyError:在创建子路由时没有顺序元素
当我在路由中使用子项时,我无法从登录页面导航到仪表板页面,如下所示:
const appRoutes: Routes = [ { path: '',redirectTo: 'login',pathMatch: 'full' },{ path: 'login',component: LoginComponent,{ path: 'dashboard',pathMatch: 'full',/* canActivate: [AuthGuard],*/ component: DashboardComponent,children: [ { path: 'online-submission/:moduleName',component: OnlineSubmissionComponent,*/data:{ breadcrumb: "online-submission" },children: [ { path: 'batch-upload-members',component: BatchUploadMembersComponent,*/data:{ breadcrumb: "batch-upload-members" } },{ path: 'select-members',component: SelectMembersComponent,*/data:{ breadcrumb: "select-members" } } ] } ] },{ path: '**',component: PageNotFoundComponent } ]. 但是,当我从路由中删除子属性并使其兄弟姐妹路由工作正常.制作儿童路线时有什么问题?我正在使用cli 1.6.0-rc.1 到目前为止我尝试了什么? >评论AuthGuard没有用,所以问题不在于那部分 Angular 2.0.1 Router EmptyError: no elements in sequence Angular2 routing issues – Zone aware error No elements in sequence Angular 2.0.1 Router EmptyError: no elements in sequence 解决方法
此错误是由Angular的路由器的最新版本引起的.
请删除还原角度版本或添加pathMatch:’full’到您的路线. export const userRoutes = [ { path: 'profile',component: ProfileComponent,pathMatch: 'full' } ]; export const appRoutes = [ { path: '',redirectTo: '/events',{ path: 'user',loadChildren: './user/user.module#UserModule' } ]; 你可以找到问题here (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |