All files / src/app app.module.ts

100% Statements 5/5
100% Branches 0/0
100% Functions 2/2
100% Lines 3/3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78                                                  1x                             44x                                                                       1x  
// Angular libs
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
 
// Ionic libs
import { IonicApp, IonicModule } from 'ionic-angular';
 
// Main
import { FbrgSmnApp } from './app.component';
 
// Pages
import { Pages } from '../pages';
 
// Providers
import { CustomProviders, ExternalProviders } from '../providers';
 
// Components and Directives
import { CustomComponents, CustomDirectives, ExternalComponents } from '../components';
 
// Libs
import { SwingModule } from 'angular2-swing';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { HttpClient, HttpClientModule } from '@angular/common/http';
 
const appSettings = {
    backButtonText: 'Retour',
    // tabsLayout: 'title-hide',
    // pageTransition: 'ios-transition',
    // modalEnter: 'modal-slide-in',
    // modalLeave: 'modal-slide-out',
    statusbarPadding: true,
    tabsHideOnSubPages: true,
    // menuType: 'reveal'
    tabsHighlight: true,
    tabsPlacement: 'bottom'
};
 
// AoT requires an exported function for factories
export function HttpLoaderFactory( http: HttpClient ) {
    return new TranslateHttpLoader( http, './assets/i18n/', '.json' );
}
 
@NgModule( {
    bootstrap: [IonicApp],
    declarations: [
        FbrgSmnApp,
        ...Pages,
        ...CustomComponents,
        ...ExternalComponents,
        ...CustomDirectives
    ],
    entryComponents: [
        FbrgSmnApp,
        ...Pages,
        ...CustomComponents,
        ...ExternalComponents
    ],
    imports: [
        BrowserModule,
        IonicModule.forRoot( FbrgSmnApp, appSettings ),
        SwingModule,
        HttpClientModule,
        TranslateModule.forRoot( {
            loader: {
                deps: [ HttpClient ],
                provide: TranslateLoader,
                useFactory: ( HttpLoaderFactory ),
            }
        } )
    ],
    providers: [
        ...CustomProviders,
        ...ExternalProviders
    ]
} )
export class AppModule {}