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 { CookieService } from "../../services/cookie-service";
27 import {ComponentFactory} from "../../utils/component-factory"
28 import { EventListenerService } from "app/services/event-listener-service";
29 import { ModalsHandler } from "app/utils";
30 import IScope = angular.IScope;
31 import { SharingService } from "../services/sharing.service";
33 /** Services we need to upgrade from angular1 to angular2 - in the future we need to rewrite them all to angular2 **/
35 export function dataTypesServiceFactory(cacheObj: ICacheObject) {
36 return cacheObj.get('Sdc.Services.DataTypesService');
39 export function sharingServiceFactory(cacheObj: ICacheObject) {
40 return cacheObj.get('Sdc.Services.SharingService');
43 export function componentServiceFactory(cacheObj: ICacheObject) {
44 return cacheObj.get('Sdc.Services.ComponentFactory');
47 export function cookieServiceFactory(cacheObj: ICacheObject) {
48 return cacheObj.get('Sdc.Services.CookieService');
51 export function stateServiceFactory(cacheObj: ICacheObject) {
52 return cacheObj.get('$state');
55 export function stateParamsServiceFactory(cacheObj: ICacheObject) {
56 return cacheObj.get('$stateParams');
59 export function scopeServiceFactory(cacheObj: ICacheObject) {
60 return cacheObj.get('$scope');
63 export function eventListenerServiceServiceFactory(cacheObj: ICacheObject) {
64 return cacheObj.get('EventListenerService');
67 export function notificationServiceFactory(cacheObj: ICacheObject) {
68 return cacheObj.get('Notification');
71 export function ModalsHandlerFactory(cacheObj: ICacheObject) {
72 return cacheObj.get('ModalsHandler');
76 export const ComponentFactoryProvider = {
77 provide: ComponentFactory,
78 useFactory: componentServiceFactory,
82 export const DataTypesServiceProvider = {
83 provide: DataTypesService,
84 useFactory: dataTypesServiceFactory,
88 export const SharingServiceProvider = {
89 provide: SharingService,
90 useFactory: sharingServiceFactory,
95 export const CookieServiceProvider = {
96 provide: CookieService,
97 useFactory: cookieServiceFactory,
101 export const StateServiceFactory = {
103 useFactory: stateServiceFactory,
107 export const ScopeServiceFactory = {
109 useFactory: scopeServiceFactory,
113 export const StateParamsServiceFactory = {
114 provide: '$stateParams',
115 useFactory: stateParamsServiceFactory,
119 // export const EventListenerServiceProvider = {
120 // provide: EventListenerService,
121 // useFactory: eventListenerServiceServiceFactory,
122 // deps: ['$injector']
125 export const NotificationServiceProvider = {
126 provide: 'Notification',
127 useFactory: notificationServiceFactory,
131 export const ModalsHandlerProvider = {
132 provide: ModalsHandler,
133 useFactory: ModalsHandlerFactory,