I need to intercept the change of ng-view and load a "loading div" overlay untill all new images are loaded.
I'm trying to suspend promises callbacks in my HttpInterceptor but I can't resolve my promise in a second time.
Here an example:
return function (promise) {
globalForTest = $q.defer();
return promise.then(function (response) {
console.log('first', response);
return globalForTest.promise;
}).then(function (response) {
console.log('second', response);
return response;
});
When I try to call globalForTest.resolve(value) nothing happens, neither an error.