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

// List Pages
import { LoginPage } from "../pages/login/login";
import { HomePage } from "../pages/home/home";
import { CustomersPage } from "../pages/customers/customers";
import { ProductsPage } from "../pages/products/products";
import { VariantsPage } from "../pages/variants/variants";
import { OrdersPage } from "../pages/orders/orders";
import { LeadsPage } from "../pages/leads/leads";
import { PhonecallsPage } from "../pages/phonecalls/phonecalls";
import { ToolsPage } from "../pages/tools/tools";
import { AboutPage } from "../pages/about/about";

// Detail Pages
import { CustomerPage } from "../pages/customer/customer";
import { ProductPage } from "../pages/product/product";
import { OrderPage } from "../pages/order/order";
import { LeadPage } from "../pages/lead/lead";
import { PhonecallPage } from "../pages/phonecall/phonecall";

// 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";
import { ImageSanitizerPipe } from "../pipes/image";

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

@NgModule({
    declarations: [
        MyApp,
        // List Pages
        LoginPage,
        HomePage,
        CustomersPage,
        ProductsPage,
        VariantsPage,
        OrdersPage,
        LeadsPage,
        PhonecallsPage,
        ToolsPage,
        AboutPage,
        // Detail Pages
        CustomerPage,
        ProductPage,
        OrderPage,
        LeadPage,
        PhonecallPage,
        // Components
        OMasterHeader,
        OMasterFooter,
        ODetailHeader,
         // Pipes
        MenuPipe,
        ImageSanitizerPipe,
        // Directives
        DoubleTap
    ],
    imports: [
        IonicModule.forRoot(MyApp),
        ReactiveFormsModule
    ],
    bootstrap: [IonicApp],
    entryComponents: [
        MyApp,
        // List Pages
        LoginPage,
        HomePage,
        CustomersPage,
        ProductsPage,
        VariantsPage,
        OrdersPage,
        LeadsPage,
        PhonecallsPage,
        // Detail Pages
        CustomerPage,
        ProductPage,
        OrderPage,
        LeadPage,
        PhonecallPage,
        // Other Pages
        ToolsPage,
        AboutPage,
    ],
    providers: [
        OdooRPCService,
        AuthService,
        OdooService,
        PouchService,
        SyncService,
        {
            provide: ErrorHandler,
            useClass: IonicErrorHandler
        }
    ]
})
export class AppModule {}
