Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 升级到7后,存储区不工作_Javascript_Angular_Typescript_Rxjs_Ngrx - Fatal编程技术网

Javascript 升级到7后,存储区不工作

Javascript 升级到7后,存储区不工作,javascript,angular,typescript,rxjs,ngrx,Javascript,Angular,Typescript,Rxjs,Ngrx,我已将我的应用程序从angular 4升级到7 我的ngrx存储模块有问题。它在Angular 4上运行得很好,但现在当我升级到最新的7时,整个应用程序都出现了错误。 说 类型存储上不存在属性“subscribe” 这就是我访问的方式 this.store .select("codeSelectionSession") .subscribe((session: TestOrderCodeSelectionSession) => { // checks for null

我已将我的应用程序从angular 4升级到7 我的ngrx存储模块有问题。它在Angular 4上运行得很好,但现在当我升级到最新的7时,整个应用程序都出现了错误。 说

类型存储上不存在属性“subscribe”

这就是我访问的方式

   this.store
  .select("codeSelectionSession")
  .subscribe((session: TestOrderCodeSelectionSession) => {
    // checks for null and undefined
    if (session == null) {
      this.store.select("testOrder").subscribe((testOrder: TestOrder) => {
        this.codeSelectionSession = new TestOrderCodeSelectionSession();
        this.store.dispatch(
          new SetTestOrderCodeSelectionSession(this.codeSelectionSession)
        );
      });
    } else {
      this.codeSelectionSession = session;
    }
  });

select和subscribe出现错误

我的商店版本是

"@ngrx/store": "4.1.1",
有人知道如何解决这个问题吗?
谢谢

您应该将@ngrx/store和其他依赖项更新到版本7,如

    "@ngrx/effects": "^7.4.0",
    "@ngrx/router-store": "^7.4.0",
    "@ngrx/store": "^7.4.0",
    "@ngrx/store-devtools": "^7.4.0",
    "@ngrx/effects": "^7.4.0",
    "@ngrx/router-store": "^7.4.0",
    "@ngrx/store": "^7.4.0",
    "@ngrx/store-devtools": "^7.4.0",