The instructions for the ng2-translate
module mention easily adding Translate
to a SharedModule
that you import into your other modules, if you're working in a modular project and you want it to be available in all modules.
This actually isn't so easy, if your project isn't already using a SharedModule that all other modules import, and/or you don't want all modules to import your SharedModule.
Is there any other way of making ng2Translate
available to all modules in your application? I had thought maybe importing it into app.module.ts but it seems like in their example, it's already imported into app.module.ts like so:
@NgModule({
imports: [
BrowserModule,
HttpModule,
TranslateModule.forRoot({
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [Http]
})
],
bootstrap: [AppComponent]
})
export class AppModule { }