Skip to content

Instantly share code, notes, and snippets.

@kutanov kutanov/shared.module.ts
Last active Dec 27, 2019

Embed
What would you like to do?
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { TranslateCompiler, TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { CommonModule } from '@angular/common';
export function createTranslateLoader(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/locale/', '.json');
}
@NgModule({
declarations: [],
imports: [
CommonModule,
TranslateModule.forChild({
loader: {
provide: TranslateLoader,
useFactory: (createTranslateLoader),
deps: [HttpClient]
},
isolate: false
}),
],
exports: [TranslateModule],
})
export class SharedModule {
static forRoot(): ModuleWithProviders {
return {
ngModule: CoreModule,
providers: [ShoppingCartService, AccountService]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.