import { NgModule, ErrorHandler } from "@angular/core";
import { ReactiveFormsModule } from "@angular/forms";
import { IonicApp, IonicModule, IonicErrorHandler } from "ionic-angular";
import { MyApp } from "./app.component";

// Pages
import { LoginPage } from "../pages/login/login";
import { HomePage } from "../pages/home/home";
import { Page1 } from '../pages/page1/page1';
import { Page2 } from '../pages/page2/page2';

// Services
import { OdooRPCService } from "angular2-odoo-jsonrpc";
import { AuthService } from "../services/auth-service";
import { OdooService } from "../services/odoo-service";
import { PouchService } from "../services/pouch-service";
import { SyncService } from "../services/sync-service";
import { DownloadService } from "../services/download-service";
import { UploadService } from "../services/upload-service";

// Pipes
import { MenuPipe } from "../pipes/menu";

@NgModule({
    declarations: [
        MyApp,
        // Pages
        LoginPage,
        HomePage,
        Page1,
        Page2,
        // Pipes
        MenuPipe
    ],
    imports: [
        IonicModule.forRoot(MyApp),
        ReactiveFormsModule
    ],
    bootstrap: [IonicApp],
    entryComponents: [
        MyApp,
        LoginPage,
        HomePage,
        Page1,
        Page2
    ],
    providers: [
        OdooRPCService,
        AuthService,
        OdooService,
        PouchService,
        SyncService,
        DownloadService,
        UploadService,
        {
            provide: ErrorHandler,
            useClass: IonicErrorHandler
        }
    ]
})
export class AppModule {}
