import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ErrorHandler } from '@angular/core';

import {MyErrorHandler} from './MyError';

import { AppComponent } from './app.component';
import { NgZorroAntdModule, NZ_CAROUSEL_CUSTOM_STRATEGIES, NZ_I18N, zh_CN } from 'ng-zorro-antd';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { registerLocaleData } from '@angular/common';
import zh from '@angular/common/locales/zh';
import {FormComponent} from './form/form.component';
import {PlayComponent} from './play/play.component';
import {BackgroundImagePipe} from './pipes/background-image.pipe';
import {TimePipe} from './pipes/time.pipe';
import {ResourcePipe} from './pipes/resource.pipe';
import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome';
import { fas } from '@fortawesome/free-solid-svg-icons';
import { far } from '@fortawesome/free-regular-svg-icons';
import { ContentsPipe } from './pipes/contents.pipe';
// import { TouchStrategy } from './play/touch-strategy';
import { CustomScrollBarDirective } from './play/scrollbar.directive';

registerLocaleData(zh);

@NgModule({
  declarations: [
    AppComponent,
    FormComponent,
    PlayComponent,
    BackgroundImagePipe,
    ResourcePipe,
    ContentsPipe,
    TimePipe,
    CustomScrollBarDirective,

  ],
  imports: [
    BrowserModule,
    NgZorroAntdModule,
    FormsModule,
    HttpClientModule,
    BrowserAnimationsModule,
    FontAwesomeModule,
    ReactiveFormsModule
  ],
  providers: [
    {provide: ErrorHandler, useClass: MyErrorHandler},
    { provide: NZ_I18N, useValue: zh_CN }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {
  constructor(library: FaIconLibrary) {
    library.addIconPacks(fas, far);
  }
}
