Advertisement
Guest User

Untitled

a guest
Jan 8th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import './vendor.ts';
  2.  
  3. import { NgModule, Injector } from '@angular/core';
  4. import { BrowserModule } from '@angular/platform-browser';
  5. import { HTTP_INTERCEPTORS } from '@angular/common/http';
  6. import { NgbDatepickerConfig } from '@ng-bootstrap/ng-bootstrap';
  7. import { Ng2Webstorage, LocalStorageService, SessionStorageService } from 'ngx-webstorage';
  8. import { JhiEventManager } from 'ng-jhipster';
  9.  
  10. import { AuthInterceptor } from './blocks/interceptor/auth.interceptor';
  11. import { AuthExpiredInterceptor } from './blocks/interceptor/auth-expired.interceptor';
  12. import { ErrorHandlerInterceptor } from './blocks/interceptor/errorhandler.interceptor';
  13. import { NotificationInterceptor } from './blocks/interceptor/notification.interceptor';
  14. import { HasuSiteSharedModule } from 'app/shared';
  15. import { HasuSiteCoreModule } from 'app/core';
  16. import { HasuSiteAppRoutingModule } from './app-routing.module';
  17. import { HasuSiteHomeModule } from './home/home.module';
  18. import { HasuSiteAccountModule } from './account/account.module';
  19. import { HasuSiteEntityModule } from './entities/entity.module';
  20. import * as moment from 'moment';
  21. // jhipster-needle-angular-add-module-import JHipster will add new module here
  22. import { HasuMainComponent, NavbarComponent, FooterComponent, PageRibbonComponent, ActiveMenuDirective, ErrorComponent } from './layouts';
  23. import { FormComponent } from './form/form.component';
  24. import { NewComponentComponent } from './new-component/new-component.component';
  25.  
  26. @NgModule({
  27.     imports: [
  28.         BrowserModule,
  29.         HasuSiteAppRoutingModule,
  30.         Ng2Webstorage.forRoot({ prefix: 'hasu', separator: '-' }),
  31.         HasuSiteSharedModule,
  32.         HasuSiteCoreModule,
  33.         HasuSiteHomeModule,
  34.         HasuSiteAccountModule,
  35.         // jhipster-needle-angular-add-module JHipster will add new module here
  36.         HasuSiteEntityModule
  37.     ],
  38.     declarations: [
  39.         HasuMainComponent,
  40.         NavbarComponent,
  41.         ErrorComponent,
  42.         PageRibbonComponent,
  43.         ActiveMenuDirective,
  44.         FooterComponent,
  45.         FormComponent,
  46.         NewComponentComponent
  47.     ],
  48.     providers: [
  49.         {
  50.             provide: HTTP_INTERCEPTORS,
  51.             useClass: AuthInterceptor,
  52.             multi: true,
  53.             deps: [LocalStorageService, SessionStorageService]
  54.         },
  55.         {
  56.             provide: HTTP_INTERCEPTORS,
  57.             useClass: AuthExpiredInterceptor,
  58.             multi: true,
  59.             deps: [Injector]
  60.         },
  61.         {
  62.             provide: HTTP_INTERCEPTORS,
  63.             useClass: ErrorHandlerInterceptor,
  64.             multi: true,
  65.             deps: [JhiEventManager]
  66.         },
  67.         {
  68.             provide: HTTP_INTERCEPTORS,
  69.             useClass: NotificationInterceptor,
  70.             multi: true,
  71.             deps: [Injector]
  72.         }
  73.     ],
  74.     bootstrap: [HasuMainComponent]
  75. })
  76. export class HasuSiteAppModule {
  77.     constructor(private dpConfig: NgbDatepickerConfig) {
  78.         this.dpConfig.minDate = { year: moment().year() - 100, month: 1, day: 1 };
  79.     }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement