AngularJS 1.0.7: Nesting parallel promises with $resources

后端 未结 1 453
傲寒
傲寒 2021-01-28 17:12

this post extends a previous one already solved. Please see it, to get in context: Nesting promises with $resources in AngularJS 1.0.7

With that approach in mind, I woul

相关标签:
1条回答
  • 2021-01-28 18:02

    As in your earlier question, there is no need to use a deferred here. Just use $q.all(), which returns a promise:

    var parseURL = function() {
      $q.all([parseBoatType(), parseDestination()])
          .then(function (results) {
              console.log(results);
              searchBoats(results);
          });
    };
    parseURL();
    
    0 讨论(0)
提交回复
热议问题