There is an excellent Q&A on displaying a global loader in an AngularJS application whenever an HTTP request is made. Is there a way to determine if there is an element associated with the call via a controller (I'm thinking of a directive or the ngController attribute)? I'd like to be able to cover the specific element with a loader.
If that isn't feasible, is there a better solution that having the relevant controllers track whether or not they've made a call and pass that to a loader directive? Ex:
<div ng-controller="MyController as mc" my-loader="mc.loading">