title: Angular JS async two API requests
body: <p>In Angular at the moment I have this:</p>
  
  <pre><code>app.factory("myService", function($http, $q) {
      return {
          doBoth: function(data) {
              return $q.all([$http.post("/search/local", data), $http.post("/search/shape", data)]);
          }
      };
  });
  </code></pre>
  
  <p>and i call it like this:</p>
  
  <pre><code>$scope.$on("localSearch", function(event, data) {
      return myService.doBoth(data);
  });
  </code></pre>
  
  <p>However I do not think it is happening asynchronously. They both take quite a time to get fulfilled so I need Angular to request both at the same time, so the complete request isn't one + the other - but the quickest time they both get returned in.</p>