Angular 2儿童路线不起作用

问题描述 投票:0回答:2

我有一个孩子的路线历史,我得到一个空的错误。

未捕获(承诺):EmptyError:序列中没有元素EmptyError:序列中没有元素

enter image description here

这是我的代码:

{path: 'calories', pathMatch: 'full', component: CaloriesComponent, canActivate: [UserService], children: [
    {path: 'history', pathMatch: 'full', component: CaloriesHistoryComponent, canActivate: [UserService]}
  ]},
angular angular2-routing
2个回答
1
投票

当使用带角度的RxJS 5.5.3(版本4/5)时会发生此错误,因此只需跳过RxJS 5.5.3,并通过将“rxjs”:“^ 5.5.4”添加到项目包中来使用RxJS 5.5.4.json


-1
投票

我没有看到您的代码有任何问题。我搜索了错误用途给了我,我发现了这篇文章。似乎与您的问题相关。我希望这有帮助。

Here is the post

© www.soinside.com 2019 - 2024. All rights reserved.