Created
February 13, 2019 01:47
-
-
Save lizzymendivil/d5b14bb5db947364d8831342ccf34016 to your computer and use it in GitHub Desktop.
ngx-translate-app-module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BrowserModule } from '@angular/platform-browser'; | |
import {HttpClient, HttpClientModule} from '@angular/common/http'; | |
import { NgModule } from '@angular/core'; | |
import {TranslateModule, TranslateLoader} from '@ngx-translate/core'; | |
import {TranslateHttpLoader} from '@ngx-translate/http-loader'; | |
import { AppComponent } from './app.component'; | |
export function HttpLoaderFactory(http: HttpClient) { | |
return new TranslateHttpLoader(http); | |
} | |
@NgModule({ | |
declarations: [ | |
AppComponent | |
], | |
imports: [ | |
BrowserModule, | |
HttpClientModule, | |
TranslateModule.forRoot({ | |
loader: { | |
provide: TranslateLoader, | |
useFactory: HttpLoaderFactory, | |
deps: [HttpClient] | |
} | |
}) | |
], | |
providers: [], | |
bootstrap: [AppComponent] | |
}) | |
export class AppModule { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment