鉴于ngrx4中的以下内容有效:
@NgModule(
{
imports: [
CommonModule,
StoreModule.forFeature(
'clerkingData',
{
appetite: appetiteDataReducer,
bleeding: bleedingDataReducer
} ),
StoreModule.forFeature(
'clerkingUi',
{
appetite: appetiteUiReducer
} )
],
exports: [ ...modules ],
declarations:
[ ...components ],
providers:
[ ]
} )
export class ClerkingModule {
}
...为什么以下情况没有。(只有'职员'在开发工具中看到)
@NgModule(
{
imports: [
CommonModule,
StoreModule.forFeature(
'clerking',
{
clerkingData: {
appetite: appetiteDataReducer,
bleeding: bleedingDataReducer
},
clerkingUi: {
appetite: appetiteUiReducer
}
} )
],
exports: [ ...modules ],
declarations:
[ ...components ],
providers:
[ ]
} )
export class ClerkingModule {
}
由于
答案 0 :(得分:0)
我不认为StoreModule.forFeature
的第二个参数(ActionReducerMap)支持嵌套的reducer。
见issue in @ngrx/store repo。 虽然ngrx4在创建此问题后问世,但我认为它仍然具有相关性。