Ok i have tons of $http() calls all around the app code,
i\'m wondering is there any way / best practice to detect when all $http() around
It is possible if you execute all requests by $q.all
$scope.request1 = $http.get('request1URL', {cache: false});
$scope.request2 = $http.get('request2URL', {'cache': false});
$scope.loading = true;
$q.all([$scope.request1, $scope.request2]).then(function(values) {
$scope.loading = false;
// Do whatever you want
// values[0], values[1]
});
Using ng-if, you can show and hide loading gif.
In case, if you use different $http call, then have a count or array in the $rootScope and update them whenever $http complete. Based on the count or array.length enable the loading gif.