title: Promise API - combining results of 2 asynchronous call
body: <p>With promise API, how to send two asynchronous request in parallel, and resolve the combined result as the response. </p>
  
  <pre><code>var get = function(id){
              var res1, res2;
              var deferred = $q.defer();
              Db.get(id, "abc")
                  .then(function (d) {
                      //deferred.resolve(d));
                      res1 = d;
                  }, function (e) {
                      //error
                  });
  
              Db.get(id, "def")
                  .then(function (d) {
                      //deferred.resolve(d));
                      res2 = d;
                  }, function (e) {
                      //error
                  });
  
              //?????? how to return {res1:res1 , res2: res2}
  
              return deferred.promise;
          };
  </code></pre>
  
  <p>now, when I call get() like</p>
  
  <pre><code>get(123).then(function(d)){
  // d= {res1: res1, res2: res2}
  },
  ...
  </code></pre>
  
  <p>I need to get the combined result as indicated. How to do this with Angular promise API?</p>