2

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.

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Can you please provide sample code for the http interceptor ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.