2

I have defined a module for data access in my angular application and I am using NgRx/Data.

The Module hierarchy looks like this:

AppModule

  • Customer-Module (LazyLoaded) -> Imports Customer-Data-Module

Within my Customer-Data-Module I have set the providers array for the pluralName configuration like this:

@NgModule({
  declarations: [

  ],
  imports: [
    CommonModule
  ],
  providers:[
    { provide: PLURAL_NAMES_TOKEN, multi: true, useValue: entityConfig.pluralNames, },
  ] 
})
export class CustomerDataModule {
  constructor(private eds: EntityDefinitionService, pluralizer: Pluralizer) {    
    eds.registerMetadataMap(entityConfig.entityMetadata);
  }
}

I found an example for this here and it works if I put the provider definition into my AppModule (but nowhere else).

Weissvonnix
  • 731
  • 7
  • 23

0 Answers0