import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {RouteReuseStrategy} from '@angular/router';
import {HttpClientModule} from '@angular/common/http';

import {IonicModule, IonicRouteStrategy} from '@ionic/angular';
import {SplashScreen} from '@ionic-native/splash-screen/ngx';
import {StatusBar} from '@ionic-native/status-bar/ngx';
import {FormsModule} from '@angular/forms';
import {HTTP_INTERCEPTORS} from '@angular/common/http';
import {NgZorroAntdMobileModule} from 'ng-zorro-antd-mobile';

import {AppComponent} from './app.component';
import {AppRoutingModule} from './app-routing.module';
import {SubTitleComponent} from './components/sub-title/sub-title.component';
import {SwitchComponent} from './components/switch/switch.component';

import {AppMinimize} from '@ionic-native/app-minimize/ngx';

import {HomePage} from './home/home.page';
import {EastPage} from './east/east.page';
import {LoginPage} from './login/login.page';
import {WestPage} from './west/west.component';

import {Api} from './service/api';
import {Auth} from './service/auth';
import {Http} from './service/http';
import {Transfer} from './service/transfer';
import {AuthInterceptor} from './service/token';

@NgModule({
    declarations: [
        AppComponent,
        SubTitleComponent,
        HomePage,
        EastPage,
        LoginPage,
        WestPage,
        SwitchComponent
    ],
    entryComponents: [],
    imports: [
        BrowserModule,
        IonicModule.forRoot(),
        AppRoutingModule,
        FormsModule,
        HttpClientModule,
        BrowserAnimationsModule,
        NgZorroAntdMobileModule
    ],
    providers: [
        StatusBar,
        SplashScreen,
        {provide: RouteReuseStrategy, useClass: IonicRouteStrategy},
        {
            provide: HTTP_INTERCEPTORS,
            useClass: AuthInterceptor,
            multi: true,
        },
        AppMinimize,
        Api,
        Auth,
        Http,
        Transfer
    ],
    bootstrap: [AppComponent]
})
export class AppModule {
}
