问题
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