import { HTTP_INTERCEPTORS , HttpClient , HttpClientModule } from '@angular/common/http' ; import { ErrorHandler , NgModule } from '@angular/core' ; import { BrowserModule } from '@angular/platform-browser' ; import { Camera } from '@ionic-native/camera' ; import { SplashScreen } from '@ionic-native/splash-screen' ; import { StatusBar } from '@ionic-native/status-bar' ; import { IonicStorageModule , Storage } from '@ionic/storage' ; import { TranslateLoader , TranslateModule } from '@ngx-translate/core' ; import { TranslateHttpLoader } from '@ngx-translate/http-loader' ; import { IonicApp , IonicErrorHandler , IonicModule } from 'ionic-angular' ; import { Settings , User } from '../providers/providers' ; import { Api } from '../providers/api/api' ; import { MyApp } from './app.component' ; import { Browser } from '../providers/browser/browser' ; import { Constant } from '../providers/constant/constant' ; import { JwtInterceptorProvider } from '../providers/jwt-interceptor/jwt-interceptor' ; export function createTranslateLoader ( http ) { return new TranslateHttpLoader ( http , './assets/i18n/' , '.json' ) ; } export function provideSettings ( storage ) { /**
     * The Settings provider takes a set of default settings for your app.
     *
     * You can add new settings options at any time. Once the settings are saved,
     * these values will not overwrite the saved values (this can be done manually if desired).
     */ return new Settings ( storage , { option1 : true , option2 : 'Ionitron J. Framework' , option3 : '3' , option4 : 'Hello' } ) ; } @ NgModule ( { declarations : [ MyApp ] , imports : [ BrowserModule , HttpClientModule , TranslateModule . forRoot ( { loader : { provide : TranslateLoader , useFactory : ( createTranslateLoader ) , deps : [ HttpClient ] } } ) , IonicModule . forRoot ( MyApp , { backButtonText : '' , iconMode : 'ios' , mode : 'ios' , } ) , IonicStorageModule . forRoot ( ) ] , bootstrap : [ IonicApp ] , entryComponents : [ MyApp ] , providers : [ Api , User , Browser , Constant , Camera , SplashScreen , StatusBar , { provide : Settings , useFactory : provideSettings , deps : [ Storage ] } , { provide : ErrorHandler , useClass : IonicErrorHandler } , { provide : HTTP_INTERCEPTORS , useClass : JwtInterceptorProvider , multi : true , } ] } ) export class AppModule { }