diff --git a/src/app/app.module.ts b/src/app/app.module.ts index b50fc2e..051a6a7 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,8 +1,8 @@ import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {CommonModule} from '@angular/common'; -import {HttpClientModule} from "@angular/common/http"; -import {BrowserModule} from '@angular/platform-browser'; +import {HTTP_INTERCEPTORS, HttpClientModule} from "@angular/common/http"; +import {BrowserModule, BrowserTransferStateModule} from '@angular/platform-browser'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {CKEditorModule} from 'ng2-ckeditor'; @@ -24,6 +24,7 @@ import {LayoutService} from "./openaireLibrary/services/layout.service"; import {SubscribeModule} from './utils/subscribe/subscribe.module'; import {ThemeComponent} from "./test/theme.component"; import {CustomizationModule} from "./utils/customization/customization.module"; +import {HttpInterceptorService} from "./openaireLibrary/http-interceptor.service"; @NgModule({ @@ -41,11 +42,19 @@ import {CustomizationModule} from "./utils/customization/customization.module"; CustomizationModule, SubscribeModule.forRoot(), BrowserModule.withServerTransition({appId: 'my-app'}), - AppRoutingModule + AppRoutingModule, + BrowserTransferStateModule ], declarations: [ AppComponent, OpenaireErrorPageComponent, ThemeComponent], exports: [ AppComponent ], - providers:[EnvironmentSpecificResolver, CommunitiesService, LayoutService], + providers:[ + EnvironmentSpecificResolver, CommunitiesService, LayoutService, + { + provide: HTTP_INTERCEPTORS, + useClass: HttpInterceptorService, + multi: true + } + ], bootstrap: [AppComponent] }) // diff --git a/src/app/app.server.module.ts b/src/app/app.server.module.ts index 79602ec..3ca5c33 100644 --- a/src/app/app.server.module.ts +++ b/src/app/app.server.module.ts @@ -1,5 +1,5 @@ import {NgModule} from '@angular/core'; -import {ServerModule} from '@angular/platform-server'; +import {ServerModule, ServerTransferStateModule} from '@angular/platform-server'; import {ModuleMapLoaderModule} from '@nguniversal/module-map-ngfactory-loader'; import {AppModule} from './app.module'; @@ -12,6 +12,7 @@ import {AppComponent} from './app.component'; AppModule, ServerModule, ModuleMapLoaderModule, + ServerTransferStateModule ], // Since the bootstrapped component is not inherited from your // imported AppModule, it needs to be repeated here.