angular ngrx store error Cannot read 属性 'schedule' of undefined

angular ngrx store error Cannot read property 'schedule' of undefined

我尝试用 Angular 实现 ngrx/Store 但我总是在控制台中收到以下错误,并且没有显示任何内容:

"TypeError: Cannot read property 'schedule' of undefined at ObserveOnSubscriber.scheduleMessage"

顺便说一句,我正在使用:

Angular CLI:1.7.4
Angular: 5.2.11

因为我是 ngrx/Store 的新手,所以我正在尝试实现以下示例: https://malcoded.com/posts/angular-ngrx-guide

即使我尝试了其他示例,但我总是得到与上述相同的错误。

我在将 ngRx/Store 集成到新应用程序时遇到了同样的问题。当我检查 npm install 日志时,我注意到了这一点:

npm WARN @ngrx/store@6.0.1 requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.

这让我相信 @ngRx/Store v6.x 需要 Angular v6。卸载 @ngRx/Store v6 并降级到 ngRx/Store v5.2.0 后,一切都非常顺利。

解决步骤:

  1. npm uninstall @ngrx/store
  2. npm install @ngrx/store@5
  3. 重新编译应用程序

由于编辑限制,添加了更多行