Hi,
Is there a way to intercept all the HTTP requests in the angular app to show common loaders?
3 Answer(s)
-
0
you can read this <a class="postlink" href="https://medium.com/@ryanchenkie_40935/angular-authentication-using-the-http-client-and-http-interceptors-2f9d1540eb8">https://medium.com/@ryanchenkie_40935/a ... f9d1540eb8</a> and this <a class="postlink" href="https://juristr.com/blog/2017/08/intercept-http-requests-in-angular/">https://juristr.com/blog/2017/08/interc ... n-angular/</a>
-
0
@ajayak just a note, we replaced Angular's Http with HttpClient recently, so it will be in v5.1.1 release. After that you can use HttpInterceptors.
But I think it is not possible to show a loader icon using HttpInterceptors because you will not have access to dom in HttpInterceptor. You can try to find another way to do this I think.
-
0
Thanks @ismcagdas