Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them, it only takes a minute:

I am trying to capture ajax start and end event in a AngularJS. While using JQuery, one can use ajaxStart, ajaxComplete etc to capture start,complete,end,fail events globally(or locally) in an application.

How can I globally track ajax events(start,end,failed) using AngularJS? I am trying to show busy indicator and disable UI during an AJax call.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

you should use $http whiile making ajax request in angulajs. then you can use the http interceptor for showing the spinner. below are links of implementation for similar requirement.

angular-spinner or angular-sham-spinner

also read this BLOG which details how should that be implemented in case you decide to implement it yourself.

share|improve this answer
1  
Can you please provide sample code for the http interceptor ? – Kumar Sambhav Aug 25 '14 at 7:05
    
the links provide the sample code – entre Aug 25 '14 at 7:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.