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";
31 /** Services we need to upgrade from angular1 to angular2 - in the future we need to rewrite them all to angular2 **/
33 export function dataTypesServiceFactory(cacheObj: ICacheObject) {
34 return cacheObj.get('Sdc.Services.DataTypesService');
37 export function sharingServiceFactory(cacheObj: ICacheObject) {
38 return cacheObj.get('Sdc.Services.SharingService');
41 export function cookieServiceFactory(cacheObj: ICacheObject) {
42 return cacheObj.get('Sdc.Services.CookieService');
45 export function stateServiceFactory(cacheObj: ICacheObject) {
46 return cacheObj.get('$state');
49 export function scopeServiceFactory(cacheObj: ICacheObject) {
50 return cacheObj.get('$scope');
53 export function stateParamsServiceFactory(cacheObj: ICacheObject) {
54 return cacheObj.get('$stateParams');
57 export function cacheServiceFactory(cacheObj: ICacheObject) {
58 return cacheObj.get('Sdc.Services.CacheService');
61 export function eventListenerServiceServiceFactory(cacheObj: ICacheObject) {
62 return cacheObj.get('EventListenerService');
65 export const DataTypesServiceProvider = {
66 provide: DataTypesService,
67 useFactory: dataTypesServiceFactory,
72 export const SharingServiceProvider = {
73 provide: SharingService,
74 useFactory: sharingServiceFactory,
79 export const CookieServiceProvider = {
80 provide: CookieService,
81 useFactory: cookieServiceFactory,
85 export const StateServiceFactory = {
87 useFactory: stateServiceFactory,
91 export const ScopeServiceFactory= {
93 useFactory: scopeServiceFactory,
97 export const StateParamsServiceFactory = {
98 provide: '$stateParams',
99 useFactory: stateParamsServiceFactory,
103 export const CacheServiceProvider = {
104 provide: CacheService,
105 useFactory: cacheServiceFactory,
109 export const EventListenerServiceProvider = {
110 provide: EventListenerService,
111 useFactory: eventListenerServiceServiceFactory,