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 ICacheObject = angular.ICacheObject;
26 import {SharingService} from "../../services/sharing-service";
27 import {CookieService} from "../../services/cookie-service";
28 import {CacheService} from "../../services/cache-service";
29 import {EventListenerService} from "app/services/event-listener-service";
30 import IScope = angular.IScope;
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 cookieServiceFactory(cacheObj: ICacheObject) {
43 return cacheObj.get('Sdc.Services.CookieService');
46 export function stateServiceFactory(cacheObj: ICacheObject) {
47 return cacheObj.get('$state');
50 export function scopeServiceFactory(cacheObj: ICacheObject) {
51 return cacheObj.get('$scope');
54 export function stateParamsServiceFactory(cacheObj: ICacheObject) {
55 return cacheObj.get('$stateParams');
58 export function cacheServiceFactory(cacheObj: ICacheObject) {
59 return cacheObj.get('Sdc.Services.CacheService');
62 export function eventListenerServiceServiceFactory(cacheObj: ICacheObject) {
63 return cacheObj.get('EventListenerService');
66 export function notificationServiceFactory(cacheObj: ICacheObject) {
67 return cacheObj.get('Notification');
70 export const DataTypesServiceProvider = {
71 provide: DataTypesService,
72 useFactory: dataTypesServiceFactory,
77 export const SharingServiceProvider = {
78 provide: SharingService,
79 useFactory: sharingServiceFactory,
84 export const CookieServiceProvider = {
85 provide: CookieService,
86 useFactory: cookieServiceFactory,
90 export const StateServiceFactory = {
92 useFactory: stateServiceFactory,
96 export const ScopeServiceFactory= {
98 useFactory: scopeServiceFactory,
102 export const StateParamsServiceFactory = {
103 provide: '$stateParams',
104 useFactory: stateParamsServiceFactory,
108 export const CacheServiceProvider = {
109 provide: CacheService,
110 useFactory: cacheServiceFactory,
114 export const EventListenerServiceProvider = {
115 provide: EventListenerService,
116 useFactory: eventListenerServiceServiceFactory,
120 export const NotificationServiceProvider = {
121 provide: 'Notification',
122 useFactory: notificationServiceFactory,