What happens with $q.all() when some calls work and others fail?

后端 未结 7 1630
生来不讨喜
生来不讨喜 2020-11-30 03:09

What happens with $q.all() when some calls work and others fail?

I have the following code:

    var entityIdColumn = $scope.entityType.toLowerCase()          


        
7条回答
  •  感情败类
    2020-11-30 03:34

    Could you not simply handle the error condition on your $http promises before passing them to $q? Promises are chained, so this should work:

    return $http.put('/api/' + $scope.entityType + '/' + entityId, rowData).then(function(r){return r;}, angular.noop);
    

    Obviously you could change the noop into any transformation you want but this prevents the rejection which prevents $q.all from failing.

提交回复
热议问题