pinalbhatt
3/27/2015 - 1:22 AM

AngularJS $http get call

AngularJS $http get call

$http.get(baseApiUrl + partialUrl, {
                params:  parms;
            })
            .success(function (result, status, headers, httpconfig) {})
            .error(function (result, status, headers, httpconfig) {});
            
            
//Function
function makeGetCall(url, parms) {
            var deferred = $q.defer();
            $http.get(url, {
                    params: parms;
                })
                .success(function (result, status, headers, httpconfig) {
                    deferred.resolve(result);
                })
                .error(function (result, status, headers, httpconfig) {
                    deferred.reject(result, status, headers, httpconfig);
                });
            return deferred.promise;
        }