2 * ================================================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property
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 * ================================================================================
24 class GetAccessService {
25 constructor($q, $log, $http, conf,uuid) {
32 getListOfApp(searchStr) {
33 //this.$log.info('GetAccessService::getListOfApp: get all app list');
34 let deferred = this.$q.defer();
35 //this.$log.info('GetAccessService::getListOfApp: searchStr', searchStr);
36 //this.$log.info('GetAccessService::getListOfApp: ', this.conf.api.listOfApp);
39 url: this.conf.api.listOfApp,
40 params: {search:searchStr},
43 // this.$log.info('GetAccessService::getListOfApp response: ', res);
44 if (Object.keys(res).length == 0) {
45 deferred.reject("GetAccessService::getListOfApp: Failed");
47 // this.$log.debug('GetAccessService::getListOfApp: query results: ', res);
48 // this.$log.info('GetAccessService::getListOfApp Succeeded');
49 deferred.resolve(res);
52 this.$log.error('GetAccessService::getListOfApp: query error: ',status);
53 deferred.reject(status);
55 return deferred.promise;
59 GetAccessService.$inject = ['$q', '$log', '$http', 'conf','uuid4'];
60 angular.module('ecompApp').service('getAccessService', GetAccessService)