title: Chaining resource in angularjs
body: <p>I would like to chain resource in AngularJS.</p>
  
  <p>The goal is that resource B wait the end of ressource A before the launch.</p>
  
  <p>I tried this:</p>
  
  <pre><code>var p = $q.when(true);
  p = p.then(function() {
      return $resource(...).query().$promise;
  });
  p = p.then(function() {
      return $resource(...).query().$promise;
  });
  p = p.then(function() {
      return $resource(...).query().$promise;
  });
  </code></pre>
  
  <p>The point is that the call is not synchronous.</p>