diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 342551e..4857317 100755 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -2,7 +2,7 @@ import {NgModule} from '@angular/core'; import {FormsModule} from '@angular/forms'; import {CommonModule} from '@angular/common'; import {HTTP_INTERCEPTORS, HttpClientModule} from "@angular/common/http"; -import {BrowserModule} from '@angular/platform-browser'; +import {BrowserModule, BrowserTransferStateModule} from '@angular/platform-browser'; import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; import {AppComponent} from './app.component'; import {OpenaireErrorPageComponent} from './error/errorPage.component'; @@ -16,6 +16,8 @@ import {NavigationBarModule} from './openaireLibrary/sharedComponents/navigation import {EnvironmentSpecificResolver} from './openaireLibrary/utils/properties/environmentSpecificResolver'; import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-interceptor.service"; +import {HttpInterceptorService} from "./openaireLibrary/http-interceptor.service"; +import {ErrorInterceptorService} from "./openaireLibrary/error-interceptor.service"; @NgModule({ @@ -29,12 +31,23 @@ import {DEFAULT_TIMEOUT, TimeoutInterceptor} from "./openaireLibrary/timeout-int NavigationBarModule, BottomModule, CookieLawModule, + BrowserTransferStateModule, BrowserModule.withServerTransition({appId: 'my-app'}), AppRoutingModule ], declarations: [ AppComponent, OpenaireErrorPageComponent], exports: [ AppComponent ], providers:[EnvironmentSpecificResolver, + { + provide: HTTP_INTERCEPTORS, + useClass: HttpInterceptorService, + multi: true + }, + { + provide: HTTP_INTERCEPTORS, + useClass: ErrorInterceptorService, + multi: true + }, [{ provide: HTTP_INTERCEPTORS, useClass: TimeoutInterceptor, multi: true }], [{ provide: DEFAULT_TIMEOUT, useValue: 30000 }] ],