2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
22 * Created by rc2122 on 4/6/2017.
24 import {DataTypesService} from "../../services/data-types-service";
25 import {CookieService} from "../../services/cookie-service";
26 import {ComponentFactory} from "../../utils/component-factory"
27 import {EventListenerService} from "app/services/event-listener-service";
28 import {ModalsHandler} from "app/utils";
29 import {SharingService} from "../services/sharing.service";
30 import ICacheObject = angular.ICacheObject;
32 /** Services we need to upgrade from angular1 to angular2 - in the future we need to rewrite them all to angular2 **/
34 export function dataTypesServiceFactory(cacheObj: ICacheObject) {
35 return cacheObj.get('Sdc.Services.DataTypesService');
38 export function sharingServiceFactory(cacheObj: ICacheObject) {
39 return cacheObj.get('Sdc.Services.SharingService');
42 export function componentServiceFactory(cacheObj: ICacheObject) {
43 return cacheObj.get('Sdc.Services.ComponentFactory');
46 export function cookieServiceFactory(cacheObj: ICacheObject) {
47 return cacheObj.get('Sdc.Services.CookieService');
50 export function stateServiceFactory(cacheObj: ICacheObject) {
51 return cacheObj.get('$state');
54 export function stateParamsServiceFactory(cacheObj: ICacheObject) {
55 return cacheObj.get('$stateParams');
58 export function scopeServiceFactory(cacheObj: ICacheObject) {
59 return cacheObj.get('$scope');
62 export function eventListenerServiceServiceFactory(cacheObj: ICacheObject) {
63 return cacheObj.get('EventListenerService');
66 export function notificationServiceFactory(cacheObj: ICacheObject) {
67 return cacheObj.get('Notification');
70 export function ModalsHandlerFactory(cacheObj: ICacheObject) {
71 return cacheObj.get('ModalsHandler');
75 export const ComponentFactoryProvider = {
76 provide: ComponentFactory,
77 useFactory: componentServiceFactory,
81 export const DataTypesServiceProvider = {
82 provide: DataTypesService,
83 useFactory: dataTypesServiceFactory,
87 export const SharingServiceProvider = {
88 provide: SharingService,
89 useFactory: sharingServiceFactory,
94 export const CookieServiceProvider = {
95 provide: CookieService,
96 useFactory: cookieServiceFactory,
100 export const StateServiceFactory = {
102 useFactory: stateServiceFactory,
106 export const ScopeServiceFactory = {
108 useFactory: scopeServiceFactory,
112 export const StateParamsServiceFactory = {
113 provide: '$stateParams',
114 useFactory: stateParamsServiceFactory,
118 export const NotificationServiceProvider = {
119 provide: 'Notification',
120 useFactory: notificationServiceFactory,
124 export const ModalsHandlerProvider = {
125 provide: ModalsHandler,
126 useFactory: ModalsHandlerFactory,