import { ErrorHandler, NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
import { RouteReuseStrategy } from '@angular/router';
import { NativeScriptModule } from '@nativescript/angular';
import { NativeScriptUISideDrawerModule } from 'nativescript-ui-sidedrawer/angular';
import { CoreModule } from '~/core/core.module';
import { CustomRouteReuseStrategy } from '~/custom-route-reuse-strategy';
import { SharedModule } from '~/shared/shared.module';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { MyErrorHandler } from './my-error-handler';
import { RoleNamePipe } from './shared/pipes/role-name.pipe';
import { NgxsActionsExecutingModule } from '@ngxs-labs/actions-executing';

// declare var GMSServices: any;

// if (platform.isIOS) {
//     GMSServices.provideAPIKey('AIzaSyAd9udiKLJ7p1NluoQoHqgi796D7Knaeiw');
// }

@NgModule({
    bootstrap: [
        AppComponent
    ],
    imports: [
        AppRoutingModule,
        NativeScriptModule,
        NativeScriptUISideDrawerModule,
        SharedModule,
        CoreModule.forRoot(),
        NgxsActionsExecutingModule.forRoot()
    ],
    declarations: [
        AppComponent
    ],
    providers: [
        {
            provide: ErrorHandler,
            useClass: MyErrorHandler
        },
        {
            provide: RouteReuseStrategy,
            useClass: CustomRouteReuseStrategy
        },
        RoleNamePipe
    ],
    schemas: [
        NO_ERRORS_SCHEMA
    ]
})
export class AppModule {
}
