Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用Angularjs$http发布状态错误_Javascript_Angularjs - Fatal编程技术网

Javascript 如何使用Angularjs$http发布状态错误

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

我是新来的

我想从我的服务器发布错误消息,例如:

使用angularJS,这是我的代码:

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)