Find the download status of the http request using Angular.js

I have searched all over the Internet and cannot find anything that says, anyway, regardless of whether I can get the status of loading data during the request of $http.get . The application that I write regularly downloads a lot of data, which can take up to 30 seconds. Instead of displaying an animated gigabyte of download, I would like to display a progress bar that shows the status of the data load. I am using Angular.js and this is what my receive request looks like.

 $http.get(<apiURL>).success(function(data,status,headers,config){ $scope.data = data; }); 

If the request succeeds, I fill in my page with data. Is there a way when it retrieves data from the server to constantly read the download status?

+4
source share
1 answer

I found a fantastic library to use what I wanted without changing the code of the internal server. This is a Github project called Angular Download Bar . Just install bower or npm and it will automatically work with your http requests using Angular. Great library.

0
source

Source: https://habr.com/ru/post/1488795/


All Articles