Abort server request in angular resource/service

36 views Asked by At

I have an angular resource call and I use it for some asynchronous operation based on user input.

The async call happens when user enters something. However, while that asynchronous operation is happening, user can enter something else, so I have to repeat the call again. Therefore, I have not one but two or more calls.

I am not interested to handle calls that are not from the last change and moreover, I would like to actively prevent my client to handle reply's of these calls as it might complicate things in client indication. Only latest call should be processed and its reply handled.

How it would be possible to cancel an ansynchronous resource call in angular prematurely, such as in case of using same call again?

0

There are 0 answers