I would like to chain resource in AngularJS.
The goal is that resource B wait the end of ressource A before the launch.
I tried this:
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;
});
The point is that the call is not synchronous.