I am looking for a way to utilize Angular.js and Restangular to determine when all child requests inside a loop have been completed. Here is an example of what I am trying to achieve:
Restangular.all('clusters').getList().then(function(clusters) {
clusters.forEach(function(cluster, index) {
cluster.get().then(function(response) {
//some logic
});
});
});
My main goal is to identify when all child requests made to cluster.get()
are finished so that I can carry out further actions. Is there an efficient method to accomplish this task?