app.config(function(RestangularProvider) {
RestangularProvider.addRequestInterceptor(function(element) {
console.log("Request initiated");
return element;
});
RestangularProvider.addResponseInterceptor(function(data) {
console.log("Request completed");
return data;
});
});
I'm currently exploring ways to implement a loading spinner feature during network requests. It seems like the typical approach involves displaying a spinner when a request begins, and then hiding it upon completion.
Is there a way to achieve this using Angular and Restangular? While I've set up interceptors as shown in the code above, they are within .config(), limiting my access to $rootScope or other elements for managing the visibility of a div.