I have changed the env property of my url to test my code locally.. It seems the error call back is not even getting called. My code snippet-
$scope.getfiles = function() {
Api.file.query().$promise.then(
function(result){ $scope.getfiles = result; }, //on success
$scope.commonAjaxErrorHandling("Failed to get File data.",true) //on failure--> Always this line of code is executing..
);
};
If I try writing other error function. It is not even getting called.
$scope.getfiles = function(){
Api.flatFile.query().$promise.then(
function(result){ $scope.File = result;
},
function (result) { // this block is not getting called
if(result.status== 404){
$scope.addErrorAlert("Service is down.Please try again later",true);
return;
}
});
};
Can someone help me out this situation?
FileServices.factory('Api', ['$res', '$loc',
function($res, $loc){
var contextPath = $loc.absUrl().split('/app/')[0];
return {
flatFile: $res(contextPath+'/app/config/flatFile/data', {}, {
query: {method:'GET', isArray:true},
save: {method:'POST'},
})
};
}]);
$qAPI.file.query(), and what are you wanting to achieve with it, please provide the code portion.