i am trying to handle the "server side error codes" in angularjs like this but it is not working $timeout(function() {
$scope.register.sales_total_amount=data2;
salesregister.save($scope.register,
function(data){
data1=data.sales_id;
},
function(error,status){
if(error.status===404)
{
alert("DATA CANNOT BE INSERTED PLEASE CHECK YOUR VALUES!!!!");
}
}
);
}, 2000);
how can i handle the these server side errors???