Javascript 如何使用Angularjs$http发布状态错误
我是新来的 我想从我的服务器发布错误消息,例如: 使用angularJS,这是我的代码:Javascript 如何使用Angularjs$http发布状态错误,javascript,angularjs,Javascript,Angularjs,我是新来的 我想从我的服务器发布错误消息,例如: 使用angularJS,这是我的代码: OwnerList.batch(obArr,function(ob){ return OwnerList.createItem(cleanOb(ob)); },4).then(function(){ $scope.Loading = false; },function(response){ // err
OwnerList.batch(obArr,function(ob){
return OwnerList.createItem(cleanOb(ob));
},4).then(function(){
$scope.Loading = false;
},function(response){
// error function
console.log(response);
alert('')
},function(progress){
$scope.OwnerListProgress = parseInt(progress * 100);
});
那么我需要在错误函数上加什么呢?谢谢。您可以简单地完成(我假设。批处理是由$http
/$resource
制作的ajax)
您可以简单地这样做(我假设。批处理是由$http
/$resource
制作的ajax)
alert(response.data.message.value)