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 {LocalNotifications} from '@ionic-native/local-notifications/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 {AlarmBarComponent} from './components/alarm-bar/alarm-bar.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 {AlarmPage} from './alarm/alarm.page';
import {RowPage} from './row/row.page';
import {IndexPage} from './index/index.page';

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';
import {Mqtt} from './service/mqtt';
import {Load} from './service/load';

@NgModule({
    declarations: [
        AppComponent,
        SubTitleComponent,
        SwitchComponent,
        AlarmBarComponent,
        HomePage,
        EastPage,
        LoginPage,
        WestPage,
        AlarmPage,
        RowPage,
        IndexPage
    ],
    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,
        LocalNotifications,
        Api,
        Auth,
        Http,
        Mqtt,
        Transfer,
        Load
    ],
    bootstrap: [AppComponent]
})
export class AppModule {
}
