From ed7e1c3dfe332abc67ed943717db2ee94406f95e Mon Sep 17 00:00:00 2001 From: Tal Gitelman Date: Thu, 29 Jun 2017 19:30:00 +0300 Subject: [SDC] rebase code Change-Id: I456ec65a233d277e6bae35e140f2e3da5765bae6 Signed-off-by: Tal Gitelman Signed-off-by: Michael Lando --- catalog-ui/src/app/ng2/app.module.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'catalog-ui/src/app/ng2/app.module.ts') diff --git a/catalog-ui/src/app/ng2/app.module.ts b/catalog-ui/src/app/ng2/app.module.ts index ea73d382e2..970c57de89 100644 --- a/catalog-ui/src/app/ng2/app.module.ts +++ b/catalog-ui/src/app/ng2/app.module.ts @@ -11,13 +11,15 @@ import { StateParamsServiceFactory, CacheServiceProvider, EventListenerServiceProvider } from "./utils/ng1-upgraded-provider"; import {ConfigService} from "./services/config.service"; -import {HttpService} from "./services/http.service"; import {HttpModule} from '@angular/http'; import {AuthenticationService} from './services/authentication.service'; import {Cookie2Service} from "./services/cookie.service"; import {ComponentServiceNg2} from "./services/component-services/component.service"; import {ServiceServiceNg2} from "./services/component-services/service.service"; import {ComponentInstanceServiceNg2} from "./services/component-instance-services/component-instance.service"; +import { InterceptorService } from 'ng2-interceptors'; +import { XHRBackend, RequestOptions } from '@angular/http'; +import {HttpInterceptor} from "./services/http.interceptor.service"; export const upgradeAdapter = new UpgradeAdapter(forwardRef(() => AppModule)); @@ -25,6 +27,13 @@ export function configServiceFactory(config:ConfigService) { return () => config.loadValidationConfiguration(); } +export function interceptorFactory(xhrBackend: XHRBackend, requestOptions: RequestOptions){ + let service = new InterceptorService(xhrBackend, requestOptions); + service.addInterceptor(new HttpInterceptor()); + return service; +} + + // export function httpServiceFactory(backend: XHRBackend, options: RequestOptions) { // return new HttpService(backend, options); // } @@ -43,7 +52,6 @@ export function configServiceFactory(config:ConfigService) { exports: [], entryComponents: [], providers: [ - HttpService, DataTypesServiceProvider, SharingServiceProvider, CookieServiceProvider, @@ -61,6 +69,11 @@ export function configServiceFactory(config:ConfigService) { useFactory: configServiceFactory, deps: [ConfigService], multi: true + }, + { + provide: InterceptorService, + useFactory: interceptorFactory, + deps: [XHRBackend, RequestOptions] } ], bootstrap: [AppComponent] -- cgit 1.2.3-korg