-
-
Notifications
You must be signed in to change notification settings - Fork 917
/
app.module.ts
69 lines (66 loc) · 2.92 KB
/
app.module.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import './vendor.ts';
import { NgModule, Injector } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
import { NgbDatepickerConfig } from '@ng-bootstrap/ng-bootstrap';
import { Ng2Webstorage, LocalStorageService, SessionStorageService } from 'ngx-webstorage';
import { JhiEventManager } from 'ng-jhipster';
import { AuthInterceptor } from './blocks/interceptor/auth.interceptor';
import { AuthExpiredInterceptor } from './blocks/interceptor/auth-expired.interceptor';
import { ErrorHandlerInterceptor } from './blocks/interceptor/errorhandler.interceptor';
import { NotificationInterceptor } from './blocks/interceptor/notification.interceptor';
import { JhipsterSampleApplicationSharedModule } from 'app/shared';
import { JhipsterSampleApplicationCoreModule } from 'app/core';
import { JhipsterSampleApplicationAppRoutingModule } from './app-routing.module';
import { JhipsterSampleApplicationHomeModule } from './home/home.module';
import { JhipsterSampleApplicationAccountModule } from './account/account.module';
import { JhipsterSampleApplicationEntityModule } from './entities/entity.module';
import * as moment from 'moment';
// jhipster-needle-angular-add-module-import JHipster will add new module here
import { JhiMainComponent, NavbarComponent, FooterComponent, PageRibbonComponent, ActiveMenuDirective, ErrorComponent } from './layouts';
@NgModule({
imports: [
BrowserModule,
JhipsterSampleApplicationAppRoutingModule,
Ng2Webstorage.forRoot({ prefix: 'jhi', separator: '-' }),
JhipsterSampleApplicationSharedModule,
JhipsterSampleApplicationCoreModule,
JhipsterSampleApplicationHomeModule,
JhipsterSampleApplicationAccountModule,
JhipsterSampleApplicationEntityModule
// jhipster-needle-angular-add-module JHipster will add new module here
],
declarations: [JhiMainComponent, NavbarComponent, ErrorComponent, PageRibbonComponent, ActiveMenuDirective, FooterComponent],
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: AuthInterceptor,
multi: true,
deps: [LocalStorageService, SessionStorageService]
},
{
provide: HTTP_INTERCEPTORS,
useClass: AuthExpiredInterceptor,
multi: true,
deps: [Injector]
},
{
provide: HTTP_INTERCEPTORS,
useClass: ErrorHandlerInterceptor,
multi: true,
deps: [JhiEventManager]
},
{
provide: HTTP_INTERCEPTORS,
useClass: NotificationInterceptor,
multi: true,
deps: [Injector]
}
],
bootstrap: [JhiMainComponent]
})
export class JhipsterSampleApplicationAppModule {
constructor(private dpConfig: NgbDatepickerConfig) {
this.dpConfig.minDate = { year: moment().year() - 100, month: 1, day: 1 };
}
}