Here is the code snippet I am currently working with:
$http.get(url).success(function(response,status,header,config) {
$scope.mymodel = response;
}
I need to verify the http status and trigger a function accordingly. Modifying all 100 instances of http.get
calls throughout the project seems tedious. Can we skip this by overriding the success function like so?
function success(response,status,header,config) {
if(status!=200){
//my stuff
}
super.success(response,status,header,config);
}
Alternatively, can we replace $http.get(url).success
with $http.get(url).success2
to inform my colleagues that henceforth they should use $http.get(url).success2
as it is better!
Update
Even though I am aware that this function is deprecated, I am obliged to use it due to project specifications.