gpt4 book ai didi

angular - @ngrx 4.x 中的错误 : No Provider for Store!

转载 作者:太空狗 更新时间:2023-10-29 17:31:24 25 4
gpt4 key购买 nike

在将我的项目从 @ngrx 2.x 迁移到 4.1.0 时,我遇到了错误消息

NullInjectorError: No provider for Store!

商店已导入,如 docs 中所示:

import { StoreModule as NgRxStoreModule } from '@ngrx/store';

@NgModule({
imports: [
NgRxStoreModule.forRoot(reducerMap, {
initialState: initial
}),
StoreRouterConnectingModule,
EffectsModule.forRoot(effects)
],
providers: [AppActions]
})
export class StoreModule {}

最佳答案

原来我的一些服务通过

导入了商店
import { Store } from '@ngrx/store/src/store'

将导入更改为

import { Store } from '@ngrx/store'

解决了问题。

关于angular - @ngrx 4.x 中的错误 : No Provider for Store!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47145248/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com