AIA.factory('ConfigurationService', function ($http, $q, $rootScope) { return { getCofigValue: function () { var deferred = $q.defer(); $http({ method: 'GET', url: 'API/api/Configuration/GetConfigurationvalues' }).success(function (data, status, headers, config) { console.log('success' + data); deferred.resolve(data); }).error(function (data, status, headers, config) { console.log('error') deferred.reject(data); }); return deferred.promise; } } });