Base solution for your next web application
Open Closed

Angular App show loader on HTTP requests #4700


User avatar
0
ajayak created

Hi,

Is there a way to intercept all the HTTP requests in the angular app to show common loaders?


3 Answer(s)
  • User Avatar
    0
    alper created
    Support Team

    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>

  • User Avatar
    0
    ismcagdas created
    Support Team

    @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.

  • User Avatar
    0
    ajayak created

    Thanks @ismcagdas