12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import './vendor.ts';
  2. import { NgModule } from '@angular/core';
  3. import { BrowserModule } from '@angular/platform-browser';
  4. import { HTTP_INTERCEPTORS } from '@angular/common/http';
  5. import { NgbDatepickerConfig } from '@ng-bootstrap/ng-bootstrap';
  6. import { Ng2Webstorage } from 'ngx-webstorage';
  7. import { NgJhipsterModule } from 'ng-jhipster';
  8. import { AuthInterceptor } from './blocks/interceptor/auth.interceptor';
  9. import { AuthExpiredInterceptor } from './blocks/interceptor/auth-expired.interceptor';
  10. import { ErrorHandlerInterceptor } from './blocks/interceptor/errorhandler.interceptor';
  11. import { NotificationInterceptor } from './blocks/interceptor/notification.interceptor';
  12. import { ZipConnectSharedModule } from 'app/shared';
  13. import { ZipConnectCoreModule } from 'app/core';
  14. import { ZipConnectAppRoutingModule } from './app-routing.module';
  15. import { ZipConnectHomeModule } from './home/home.module';
  16. import { ZipConnectAccountModule } from './account/account.module';
  17. import { ZipConnectEntityModule } from './entities/entity.module';
  18. import * as moment from 'moment';
  19. // jhipster-needle-angular-add-module-import JHipster will add new module here
  20. import { JhiMainComponent, NavbarComponent, FooterComponent, PageRibbonComponent, ActiveMenuDirective, ErrorComponent } from './layouts';
  21. @NgModule({
  22. imports: [
  23. BrowserModule,
  24. ZipConnectAppRoutingModule,
  25. Ng2Webstorage.forRoot({ prefix: 'jhi', separator: '-' }),
  26. NgJhipsterModule.forRoot({
  27. // set below to true to make alerts look like toast
  28. alertAsToast: false,
  29. alertTimeout: 5000,
  30. i18nEnabled: true,
  31. defaultI18nLang: 'en'
  32. }),
  33. ZipConnectSharedModule.forRoot(),
  34. ZipConnectCoreModule,
  35. ZipConnectHomeModule,
  36. ZipConnectAccountModule,
  37. // jhipster-needle-angular-add-module JHipster will add new module here
  38. ZipConnectEntityModule
  39. ],
  40. declarations: [JhiMainComponent, NavbarComponent, ErrorComponent, PageRibbonComponent, ActiveMenuDirective, FooterComponent],
  41. providers: [
  42. {
  43. provide: HTTP_INTERCEPTORS,
  44. useClass: AuthInterceptor,
  45. multi: true
  46. },
  47. {
  48. provide: HTTP_INTERCEPTORS,
  49. useClass: AuthExpiredInterceptor,
  50. multi: true
  51. },
  52. {
  53. provide: HTTP_INTERCEPTORS,
  54. useClass: ErrorHandlerInterceptor,
  55. multi: true
  56. },
  57. {
  58. provide: HTTP_INTERCEPTORS,
  59. useClass: NotificationInterceptor,
  60. multi: true
  61. }
  62. ],
  63. bootstrap: [JhiMainComponent]
  64. })
  65. export class ZipConnectAppModule {
  66. constructor(private dpConfig: NgbDatepickerConfig) {
  67. this.dpConfig.minDate = { year: moment().year() - 100, month: 1, day: 1 };
  68. }
  69. }