I found some examples of module's forRoot() method like the one below:
export class CoreModule {
constructor(
@Optional()
@SkipSelf()
parentModule: CoreModule
) {
if (parentModule) {
throw new Error(
'CoreModule is already loaded. Import it in the AppModule only'
);
}
}
static forRoot(someParameters?:string[]): ModuleWithProviders {
return {
ngModule: CoreModule,
providers: [AnProvider1, AnProvider2]
};
}
But how can I to pass the parameter values to any of the module's declared providers ?