1 | import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
---|
2 | import { NgModule } from '@angular/core';
|
---|
3 | import { RouterModule } from '@angular/router';
|
---|
4 | import { StoreModule } from '@ngrx/store';
|
---|
5 | import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
---|
6 |
|
---|
7 | import { environment } from '@env/environment';
|
---|
8 | import { SharedAppModule } from '../shared-app/shared-app.module';
|
---|
9 | import { SharedMaterialModule } from '../shared-material/shared-material.module';
|
---|
10 | import { COMPONENTS } from './components/components';
|
---|
11 | import { GUARDS } from './guards/guards';
|
---|
12 | import { LoaderInterceptor } from './interceptors/loader.interceptor';
|
---|
13 | import { SERVICES } from './services/services';
|
---|
14 | import { reducers } from './state';
|
---|
15 | import { TokenInterceptor } from './interceptors/token.interceptor';
|
---|
16 | import { EffectsModule } from '@ngrx/effects';
|
---|
17 | import { QuestionEffects } from './state/question-state/question.effects';
|
---|
18 |
|
---|
19 | @NgModule({
|
---|
20 | declarations: [COMPONENTS],
|
---|
21 | providers: [
|
---|
22 | SERVICES,
|
---|
23 | GUARDS,
|
---|
24 | { provide: HTTP_INTERCEPTORS, useClass: LoaderInterceptor, multi: true },
|
---|
25 | { provide: HTTP_INTERCEPTORS, useClass: TokenInterceptor, multi: true }
|
---|
26 | ],
|
---|
27 | imports: [
|
---|
28 | SharedAppModule,
|
---|
29 | HttpClientModule,
|
---|
30 | SharedMaterialModule,
|
---|
31 | RouterModule,
|
---|
32 | StoreModule.forRoot(reducers),
|
---|
33 | StoreDevtoolsModule.instrument({
|
---|
34 | name: 'finki-chattery App DevTools',
|
---|
35 | maxAge: 25,
|
---|
36 | logOnly: !environment.production
|
---|
37 | }),
|
---|
38 | EffectsModule.forRoot([QuestionEffects])
|
---|
39 | ],
|
---|
40 | exports: [HttpClientModule, COMPONENTS]
|
---|
41 | })
|
---|
42 | export class CoreModule {}
|
---|