summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/utils/ng1-upgraded-provider.ts
diff options
context:
space:
mode:
authorMichael Lando <ml636r@att.com>2018-07-29 16:13:45 +0300
committerMichael Lando <ml636r@att.com>2018-07-29 16:20:34 +0300
commit5b593496b8f1b8e8be8d7d2dbcc223332e65a49b (patch)
tree2f9dfc45191e723da69cf74be7829784e9741b94 /catalog-ui/src/app/ng2/utils/ng1-upgraded-provider.ts
parent9200382f2ce7b4bb729aa287d0878004b2d2b4f9 (diff)
re base code
Change-Id: I12a5ca14a6d8a87e9316b9ff362eb131105f98a5 Issue-ID: SDC-1566 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'catalog-ui/src/app/ng2/utils/ng1-upgraded-provider.ts')
-rw-r--r--catalog-ui/src/app/ng2/utils/ng1-upgraded-provider.ts45
1 files changed, 34 insertions, 11 deletions
diff --git a/catalog-ui/src/app/ng2/utils/ng1-upgraded-provider.ts b/catalog-ui/src/app/ng2/utils/ng1-upgraded-provider.ts
index c005efcbe8..fcb21c0c83 100644
--- a/catalog-ui/src/app/ng2/utils/ng1-upgraded-provider.ts
+++ b/catalog-ui/src/app/ng2/utils/ng1-upgraded-provider.ts
@@ -21,12 +21,14 @@
/**
* Created by rc2122 on 4/6/2017.
*/
-import {DataTypesService} from "../../services/data-types-service";
+import { DataTypesService } from "../../services/data-types-service";
import ICacheObject = angular.ICacheObject;
-import {SharingService} from "../../services/sharing-service";
-import {CookieService} from "../../services/cookie-service";
-import {CacheService} from "../../services/cache-service";
-import {EventListenerService} from "app/services/event-listener-service";
+import { SharingService } from "../../services/sharing-service";
+import { CookieService } from "../../services/cookie-service";
+import { CacheService } from "../../services/cache-service";
+import {ComponentFactory} from "../../utils/component-factory"
+import { EventListenerService } from "app/services/event-listener-service";
+import { ModalsHandler } from "app/utils";
import IScope = angular.IScope;
/** Services we need to upgrade from angular1 to angular2 - in the future we need to rewrite them all to angular2 **/
@@ -39,6 +41,10 @@ export function sharingServiceFactory(cacheObj: ICacheObject) {
return cacheObj.get('Sdc.Services.SharingService');
}
+export function componentServiceFactory(cacheObj: ICacheObject) {
+ return cacheObj.get('Sdc.Services.ComponentFactory');
+}
+
export function cookieServiceFactory(cacheObj: ICacheObject) {
return cacheObj.get('Sdc.Services.CookieService');
}
@@ -47,14 +53,14 @@ export function stateServiceFactory(cacheObj: ICacheObject) {
return cacheObj.get('$state');
}
-export function scopeServiceFactory(cacheObj: ICacheObject) {
- return cacheObj.get('$scope');
-}
-
export function stateParamsServiceFactory(cacheObj: ICacheObject) {
return cacheObj.get('$stateParams');
}
+export function scopeServiceFactory(cacheObj: ICacheObject) {
+ return cacheObj.get('$scope');
+}
+
export function cacheServiceFactory(cacheObj: ICacheObject) {
return cacheObj.get('Sdc.Services.CacheService');
}
@@ -67,6 +73,18 @@ export function notificationServiceFactory(cacheObj: ICacheObject) {
return cacheObj.get('Notification');
}
+
+export const ComponentFactoryProvider = {
+ provide: ComponentFactory,
+ useFactory: componentServiceFactory,
+ deps: ['$injector']
+};
+
+
+export function ModalsHandlerFactory(cacheObj: ICacheObject) {
+ return cacheObj.get('ModalsHandler');
+}
+
export const DataTypesServiceProvider = {
provide: DataTypesService,
useFactory: dataTypesServiceFactory,
@@ -93,7 +111,7 @@ export const StateServiceFactory = {
deps: ['$injector']
};
-export const ScopeServiceFactory= {
+export const ScopeServiceFactory = {
provide: '$scope',
useFactory: scopeServiceFactory,
deps: ['$injector']
@@ -104,7 +122,6 @@ export const StateParamsServiceFactory = {
useFactory: stateParamsServiceFactory,
deps: ['$injector']
};
-
export const CacheServiceProvider = {
provide: CacheService,
useFactory: cacheServiceFactory,
@@ -122,3 +139,9 @@ export const NotificationServiceProvider = {
useFactory: notificationServiceFactory,
deps: ['$injector']
};
+
+export const ModalsHandlerProvider = {
+ provide: ModalsHandler,
+ useFactory: ModalsHandlerFactory,
+ deps: ['$injector']
+}