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

// Components
import { OMasterHeader } from "../components/omaster-header/omaster-header";
import { OMasterFooter } from "../components/omaster-footer/omaster-footer";
import { ODetailHeader } from "../components/odetail-header/odetail-header";

// Pages
import { LoginPage } from "../pages/login/login";
import { HomePage } from "../pages/home/home";
import { ProductsPage } from "../pages/products/products";
import { OrdersPage } from "../pages/orders/orders";
import { ToolsPage } from "../pages/tools/tools";
import { AboutPage } from "../pages/about/about";

// 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";

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

// Directives
import { DoubleTap } from "../directives/double-tap";

@NgModule({
    declarations: [
        MyApp,
        // Pages
        LoginPage,
        HomePage,
        ProductsPage,
        OrdersPage,
        ToolsPage,
        AboutPage,
        // Components
        OMasterHeader,
        OMasterHeader,
        ODetailHeader,
         // Pipes
        MenuPipe,
        // Directives
        DoubleTap
    ],
    imports: [
        IonicModule.forRoot(MyApp),
        ReactiveFormsModule
    ],
    bootstrap: [IonicApp],
    entryComponents: [
        MyApp,
        LoginPage,
        HomePage,
        ProductsPage,
        OrdersPage,
        ToolsPage,
        AboutPage
    ],
    providers: [
        OdooRPCService,
        AuthService,
        OdooService,
        PouchService,
        SyncService,
        {
            provide: ErrorHandler,
            useClass: IonicErrorHandler
        }
    ]
})
export class AppModule {}
