$ionicLoading waiting for multiple processes

Hi all, I have a refresh function that makes two separate remote API calls


I would like to perform $ionicLoading.show(); before th first call and then do $ionicLoading.hide(); when both responses are complete.

I assume there is a really elegant way for doing such a thing, but being new to Ionic/AngularJS, I can’t get my head around it yet.

Is anyone able to offer any input, or link me to a relevant article for such a thing?


It shoud be like this.

$scope.refreshAll() = function(){


        // handling responses here


This require AngularJs Promises $q. Remember that $scope.refreshSomething() and $scope.refreshSomethingElse() must return promise .


Thank you so much :smile:

I’ve seen the mention of $q before, but was never able to quite get my head around it. Your example not only gives me exactly what I want, but it’s a brilliant example of what $q can be used for.

Thanks once again!

You’re welcome… glad to help :smile: