import {NgModule, ErrorHandler} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {IonicApp, IonicModule, IonicErrorHandler} from 'ionic-angular';
import {MyApp} from './app.component';

import {StatusBar} from '@ionic-native/status-bar';
import {SplashScreen} from '@ionic-native/splash-screen';
import {IonicStorageModule} from '@ionic/storage';
import {Calendar} from '@ionic-native/calendar';
import {TabsModule} from '../pages/tabs/tabs.module';
import {LoginModule} from '../pages/login/login.module';
import {HttpModule, JsonpModule} from '@angular/http';
import {AppService} from '../service/appHttpService';
import {AppUpdateService} from '../service/appUpdateService';
import {ActivityStatisticService} from '../service/activityStatisticService';
import {AppVersion} from '@ionic-native/app-version';
import {FileOpener} from '@ionic-native/file-opener';
import {FileTransfer, FileTransferObject} from '@ionic-native/file-transfer';
import {File} from '@ionic-native/file';
import {Keyboard} from '@ionic-native/keyboard';
import {Badge} from "@ionic-native/badge";
import {Geolocation} from "@ionic-native/geolocation";
import {ContactModalPage} from "../pages/contact/contact-modal/contact-modal";
import {PersonPage} from "../pages/home/surveyManage/modal/person/person";
import {PersonListPage} from "../pages/contact/person-list/person-list";
import {DatePipe} from "@angular/common";
import {BlockModalPage} from "../pages/home/activity-track/block-modal/block-modal";
import {QuestionDetailPage} from "../pages/home/mySurvey/question-detail/question-detail";
import {DirectivesModule} from "../directives/directives.module";

@NgModule({
    declarations: [
        MyApp,
        ContactModalPage,
        PersonPage,
        PersonListPage,
        BlockModalPage,
        QuestionDetailPage
    ],
    imports: [
        BrowserModule,
        IonicModule.forRoot(MyApp, {
            tabsHideOnSubPages: 'true',
            backButtonText: '',   //返回按钮显示中文
            statusbarPadding: false,
            iconModel: 'ios',   //icon显示图标为IOS版
            mode: 'ios',   //安卓和IOS的样式以IOS样式为准
            modalEnter: 'modal-slide-in',
            modalLeave: 'modal-slide-out'
        }),
        IonicStorageModule.forRoot(),
        TabsModule,
        LoginModule,
        HttpModule,
        JsonpModule
    ],
    bootstrap: [IonicApp],
    entryComponents: [
        MyApp,
        ContactModalPage,
        PersonPage,
        PersonListPage,
        BlockModalPage,
        QuestionDetailPage
    ],
    providers: [
        StatusBar,
        SplashScreen,
        AppService,
        AppUpdateService,
        AppVersion,
        FileOpener,
        FileTransfer,
        FileTransferObject,
        File,
        Keyboard,
        Calendar,
        Badge,
        Geolocation,
        ActivityStatisticService,
        DatePipe,
        {provide: ErrorHandler, useClass: IonicErrorHandler}
    ]
})
export class AppModule {
}
