Created
March 5, 2020 13:17
-
-
Save CharlesGrimont/faaaef419fe65c9a2797f82ec114b690 to your computer and use it in GitHub Desktop.
This file contains hidden or 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, ErrorHandler } from '@angular/core'; | |
import { HttpClient, HttpClientModule,HTTP_INTERCEPTORS } from '@angular/common/http'; | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; | |
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; | |
import { IonicApp, IonicModule, IonicErrorHandler, DeepLinkConfig } from 'ionic-angular'; | |
import { StatusBar } from '@ionic-native/status-bar'; | |
import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; | |
import { TranslateHttpLoader } from '@ngx-translate/http-loader'; | |
import { C8o, HttpXsrfInterceptor } from "c8osdkangular"; | |
import { C8oRouter } from 'c8ocaf'; | |
import { ActionBeans } from '../services/actionbeans.service'; | |
import { MyApp } from './app.component'; | |
/** | |
* Deep links to your pages so that the app can rout directly to the page url | |
*/ | |
export const deepLinkConfig: DeepLinkConfig = { | |
links: [] | |
}; | |
/** | |
* Customize the ngx-translate loader for assets/i18n | |
*/ | |
export function createTranslateLoader(http: HttpClient) { | |
return new TranslateHttpLoader(http, './assets/i18n/', '.json'); | |
} | |
@NgModule({ | |
declarations: [ | |
MyApp, | |
], | |
imports: [ | |
BrowserModule, | |
BrowserAnimationsModule, | |
HttpClientModule, | |
FormsModule, | |
ReactiveFormsModule, | |
TranslateModule.forRoot({ | |
loader: { | |
provide: TranslateLoader, | |
useFactory: (createTranslateLoader), | |
deps: [HttpClient] | |
} | |
}), | |
IonicModule.forRoot(MyApp, {preloadModules: true}) | |
], | |
bootstrap: [IonicApp], | |
entryComponents: [ | |
MyApp, | |
], | |
providers: [ | |
StatusBar, | |
C8o, | |
C8oRouter, | |
ActionBeans, | |
{provide: ErrorHandler, useClass: IonicErrorHandler}, | |
{ | |
provide: HTTP_INTERCEPTORS, | |
useClass: HttpXsrfInterceptor, | |
multi: true | |
}, | |
] | |
}) | |
export class AppModule {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment