当某些调用有效而其他调用失败时 $q.all() 会发生什么?
我有以下代码:
    var entityIdColumn = $scope.entityType.toLowerCase() + 'Id';
    var requests = $scope.grid.data
      .filter(function (rowData, i) {
          return !angular.equals(rowData, $scope.grid.backup[i]);
      })
      .map(function (rowData, i) {
          var entityId = rowData[entityIdColumn];
          return $http.put('/api/' + $scope.entityType + '/' + entityId, rowData);
      });
    $q.all(requests).then(function (allResponses) {
        //if all the requests succeeded, this will be called, and $q.all will get an
        //array of all their responses.
        console.log(allResponses[0].data);
    }, function (error) {
        //This will be called if $q.all finds any of the requests erroring.
        var abc = error;
        var def = 99;
    });
当所有 $http 调用工作时,allResponses 数组将填充数据。
当一个失败时,我的理解是将调用第二个函数并给出错误变量的详细信息。
但是,有人可以帮助我解释如果某些响应有效而其他响应失败会发生什么吗?