import { Board001Service } from './views/board/board001/board001.service';
import { LoginService } from "./service/login.service";
import { SysDataService } from "./service/sys-data.service";
import { HttpModule } from "@angular/http";
import { BrowserModule } from "@angular/platform-browser";
import { NgModule } from "@angular/core";
import { LocationStrategy, HashLocationStrategy } from "@angular/common";
import { AppComponent } from "./app.component";

// import { TimeAgoPipe } from "time-ago-pipe";

// Import containers
import { FullLayoutComponent, SimpleLayoutComponent } from "./containers";

const APP_CONTAINERS = [FullLayoutComponent, SimpleLayoutComponent];

// Import components
import {
  AppAsideComponent,
  AppBreadcrumbsComponent,
  AppFooterComponent,
  AppHeaderComponent,
  AppSidebarComponent,
  AppSidebarFooterComponent,
  AppSidebarFormComponent,
  AppSidebarHeaderComponent,
  AppSidebarMinimizerComponent,
  APP_SIDEBAR_NAV
} from "./components";

const APP_COMPONENTS = [
  AppAsideComponent,
  AppBreadcrumbsComponent,
  AppFooterComponent,
  AppHeaderComponent,
  AppSidebarComponent,
  AppSidebarFooterComponent,
  AppSidebarFormComponent,
  AppSidebarHeaderComponent,
  AppSidebarMinimizerComponent,
  APP_SIDEBAR_NAV
];

// Import directives
import {
  AsideToggleDirective,
  NAV_DROPDOWN_DIRECTIVES,
  ReplaceDirective,
  SIDEBAR_TOGGLE_DIRECTIVES
} from "./directives";

const APP_DIRECTIVES = [
  AsideToggleDirective,
  NAV_DROPDOWN_DIRECTIVES,
  ReplaceDirective,
  SIDEBAR_TOGGLE_DIRECTIVES
];

// Import routing module
import { AppRoutingModule } from "./app.routing";

// Import 3rd party components
import { BsDropdownModule } from "ngx-bootstrap/dropdown";
import { TabsModule } from "ngx-bootstrap/tabs";
import { ModalModule } from "ngx-bootstrap/modal";
import { AccordionModule } from "ngx-bootstrap/accordion";
import { ChartsModule } from "ng2-charts/ng2-charts";
import { SweetAlert2Module } from "@toverux/ngx-sweetalert2";
// import { TimeAgoPipe } from "time-ago-pipe";

// import { LoadingModule } from "ngx-loading";
// import { AgmCoreModule } from "@agm/core";
import { HelperService } from "app/service/helper.service";
import { MroDataService } from "app/service/mro-data.service";

import { Sys002Service } from "app/views/sys/sys002/sys002.service";
import { Sys004Service } from "app/views/sys/sys004/sys004.service";
import { Set001Service } from "app/views/set/set001/set001.service";
import { Set002Service } from "./views/set/set002/set002.service";
import { Set003Service } from "app/views/set/set003/set003.service";

import { HttpService } from "app/service/http.service";
import { LoginModule } from "app/views/login/login.module";
import { AuthGuard } from "app/auth-guard.service";
import { SetDataService } from "app/service/set-data.service";
import { Sys005Service } from "app/views/sys/sys005/sys005.service";
import { Sys006Service } from "app/views/sys/sys006/sys006.service";
import { BoardDataService } from './service/board-data.service';

// import { InfoComponent } from './views/info/info.component';

@NgModule({
  imports: [
    BrowserModule,
    AppRoutingModule,
    BsDropdownModule.forRoot(),
    TabsModule.forRoot(),
    ModalModule.forRoot(),
    AccordionModule.forRoot(),
    SweetAlert2Module.forRoot(),
    ChartsModule,
    // LoadingModule,
    HttpModule,
    LoginModule
    // TimeAgoPipe
    // AgmCoreModule.forRoot({
    //   apiKey: "AIzaSyABeRdjDq-nodR8XjO4lzk_QAmjVJLqqis",
    //   language: "zh-TW"
    // })
  ],
  declarations: [
    AppComponent,
    ...APP_CONTAINERS,
    ...APP_COMPONENTS,
    ...APP_DIRECTIVES
    // TimeAgoPipe
    // InfoComponent
  ],
  providers: [
    {
      provide: LocationStrategy,
      useClass: HashLocationStrategy
    },
    SysDataService,
    SetDataService,
    MroDataService,
    HelperService,
    BoardDataService,
    Sys002Service,
    Sys004Service,
    Sys005Service,
    Sys006Service,
    Set001Service,
    Set002Service,
    Set003Service,
    Board001Service,
    HttpService,
    LoginService,
    AuthGuard
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}
