-
Notifications
You must be signed in to change notification settings - Fork 222
Open
Description
Hi @edcarroll,
I'm working on a project with a lot of lazy loading modules. It seems that the SuiLocalizationService isn't working with lazy loading modules. If I change the locale in my AppComponent (and I expect that other modules will use this locale) it won't affect lazy loading modules as they are creating their own SuiLocalizationService instance. The plunkr example ilustrates this issue.
Maybe SuiLocalizationModule can be rewrited like this:
@NgModule({
imports: [CommonModule]
})
export class SuiLocalizationModule {
public static forRoot():ModuleWithProviders {
return {
ngModule: SuiLocalizationModule,
providers: [
SuiLocalizationService
]
};
}
}
So in root module we can import this module as SuiLocalizationModule.forRoot() and there will be only one SuiLocalizationService.