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

后端 未结 7 1589
生来不讨喜
生来不讨喜 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:39

    Here is a small answer to it. In this fiddle you can see how it works, if an error occurs in some promise.

    $q.all([test1(), test2()]).then(function() {
      // success
    }, function() {
      // error
    });
    

    http://jsfiddle.net/wd9w0ja4/

    0 讨论(0)
提交回复
热议问题