Closed atefcharef closed 7 years ago
You can use $q.all
to make multiple requests:
var promises = [];
for (var us in users) {
promises.push(Restangular.all(URL).post(us);
}
$q.all(promises).then(function (responses) {
// responses is an array with one return value per request made
});
Does that work for you?
thank you it works!
I need to call a list of restangular.post inside of a loop, to add many user (for example)
I have a factory that do something like that:
then in controller In need to call this factory inside of a loop:
the problem is that I cant do this! it add always only the last user object!, so how to do $q.all() using Restangular, or there are any other solution??