For my app, users have the ability to create and delete items. I've implemented $resources for this functionality, which is working really well. However, I'd like to implement a loading screen that appears whenever a request is being processed.
// Implement loading-screen display
// ...
Item.destroy({'id': item.id}, function( response ){
// Handle success
// ...
// Hide loading-screen
}, function( error ){
// Handle error
// ...
// Hide loading-screen
});
Instead of manually showing and hiding the loading screen with each resource call, I'm looking for a way to configure the resourcemodule to automatically handle displaying and hiding the loading screen whenever data is being loaded from a resource. Is there a way to achieve this configuration?