import {Store} from '@ngrx/store';
import {StateStoreModule} from '../../state-store/state-store.module';
constructor(private route: ActivatedRoute, private sheetService: sheetService, private store:Store<StateStoreModule>)
只要不引入 Store 一切正常
"dependencies": {
"@angular/animations": "~8.2.3",
"@angular/common": "~8.2.3",
"@angular/compiler": "~8.2.3",
"@angular/core": "~8.2.3",
"@angular/forms": "~8.2.3",
"@angular/platform-browser": "~8.2.3",
"@angular/platform-browser-dynamic": "~8.2.3",
"@angular/router": "~8.2.3",
"@ngrx/store": "^9.0.0",
"@ngrx/store-devtools": "^9.0.0",
"minireset.css": "0.0.5",
"ng-zorro-antd": "^8.1.2",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
这是package.json 配置文件
上述错误是提示你:没有找到Store的提供者,所以发生了NullInjectorError。解决的方法是在当前组件所有在的模块中的imports中,加入Store的提供者.