Last active
December 18, 2019 14:41
-
-
Save kutanov/3467129f04bf4a917da958bc326f5b15 to your computer and use it in GitHub Desktop.
App module configuration
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 { NgModule } from '@angular/core'; | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; | |
import { SplashScreen } from '@ionic-native/splash-screen/ngx'; | |
import { StatusBar } from '@ionic-native/status-bar/ngx'; | |
import { IonicModule } from '@ionic/angular'; | |
import { IonicStorageModule } from '@ionic/storage'; | |
import { AppRoutingModule } from './app-routing.module'; | |
import { AppComponent } from './app.component'; | |
import { ServiceWorkerModule } from '@angular/service-worker'; | |
import { environment } from '../environments/environment'; | |
import { FormsModule } from '@angular/forms'; | |
import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; | |
import { TranslateHttpLoader } from '@ngx-translate/http-loader'; | |
import { HttpClientModule, HttpClient } from '@angular/common/http'; | |
export function httpLoaderFactory(http: HttpClient) { | |
return new TranslateHttpLoader(http, './assets/locale/', '.json'); | |
} | |
@NgModule({ | |
imports: [ | |
BrowserModule, | |
AppRoutingModule, | |
HttpClientModule, | |
FormsModule, | |
TranslateModule.forRoot({ | |
loader: { | |
provide: TranslateLoader, | |
useFactory: (httpLoaderFactory), | |
deps: [HttpClient] | |
} | |
}), | |
IonicModule.forRoot(), | |
IonicStorageModule.forRoot(), | |
ServiceWorkerModule.register('ngsw-worker.js', { | |
enabled: environment.production | |
}) | |
], | |
declarations: [AppComponent], | |
providers: [InAppBrowser, SplashScreen, StatusBar], | |
bootstrap: [AppComponent] | |
}) | |
export class AppModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment