我正在使用新的ngrx 5。这是包含reducers 和featureSelector 的文件:
import AppState from '../interfaces/app.state'
import { ActionReducerMap, createFeatureSelector } from '@ngrx/store'
import { partnerReducer } from './partner.reducer'
export const reducers: ActionReducerMap<AppState> = {
partnerState: partnerReducer
}
export const getAppState = createFeatureSelector<AppState>('appState')
这就是我导入 storeModule 的方式
@NgModule({
declarations: [...],
imports: [...
RouterModule.forRoot(ROUTES),
StoreModule.forFeature('appState', reducers)
],
providers: [...],
bootstrap: [AppComponent],
entryComponents: [...]
})
export class AppModule { }
我已经按照这个教程
当我运行该应用程序时,我收到以下错误:
"StaticInjectorError(AppModule)[StoreFeatureModule -> ReducerManager]:
\n StaticInjectorError(Platform: core)[StoreFeatureModule -> ReducerManager]:
\n NullInjectorError: No provider for ReducerManager!"
但是,如果我确实在提供程序中提供了 ReducerManager,我会收到此错误:
No provider for ReducerManagerDispatcher!