S
S
Sergey Nikolaev2015-12-21 11:21:14
Angular
Sergey Nikolaev, 2015-12-21 11:21:14

How to force $http of angular not to make requests?

There is a request outside of angular, before the return of which it is necessary that no $http request be called. How to do something like this? Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-12-21
@Devastor

1) we make our own wrapper over $http (you can use a decorator service).
2) inside the chain promises so that if something happens, postpone requests
3) ...
4) profit.
The simplest option, if you need to do this globally, is interceptors.
As an implementation example, you can look at angular-http-auth . There inside there is an internal queue of requests.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question