Anything like AngularJS's $http.pendingRequests in Angular's HttpClient

本小妞迷上赌 提交于 2020-01-24 18:07:06

问题


I was working on AngularJS before and I know there is a build-in property called $http.pendingRequests which can tell me if there is any pending http request existing.

Now I am working on Angular 4.4.6 and using HttpClient from @angular/common/http.

My Goal

I would like to use such result to display a loading message when any http request happens and hide it when all requests finish.

My Search

Did NOT get any luck via search or going through all the @angular/common/http source codes.

My Question

  • How can I find if there is any pending http request existing.
  • Or I have to implement it by myself?

Thanks in advance.

来源:https://stackoverflow.com/questions/46860458/anything-like-angularjss-http-pendingrequests-in-angulars-httpclient

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!