I was wondering if there is any possibility to get a callback at the end of a series of requests. I'm attaching an example code so you can better understand :
for (var i = 0; i < $scope.array.length; i++) {
factory.getX($scope.array[i].id)
.success(function (_response) {
/* call function if it's the last request in the for loop*/
})
.error(function (_err) {
$scope.displayAlert(_err)
})
}
In the factory object, I have a $http.get() function. Thanks !
$q.all