summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/app.module.ts
diff options
context:
space:
mode:
authorTal Gitelman <tg851x@intl.att.com>2017-06-29 19:30:00 +0300
committerMichael Lando <ml636r@att.com>2017-06-29 21:32:19 +0300
commited7e1c3dfe332abc67ed943717db2ee94406f95e (patch)
treee0f2f39596656456272900f59aadc3dff6c6e828 /catalog-ui/src/app/ng2/app.module.ts
parent68ccc45de18f41cddb79de33a245bceb3b063ffb (diff)
[SDC] rebase code
Change-Id: I456ec65a233d277e6bae35e140f2e3da5765bae6 Signed-off-by: Tal Gitelman <tg851x@intl.att.com> Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/app.module.ts')
-rw-r--r--catalog-ui/src/app/ng2/app.module.ts17
1 files changed, 15 insertions, 2 deletions
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]