javascript - how to use ng-webwoker in angularjs to call webapi and download files as background -


we downloading multiple huge files in client side, download process takes time like(2-3 minutes), during time not able navigate other pages in our website. want download process should run back-ground thread, want use ng-webworker operation.

$scope.downloadfiles= function(){ $http.get({rdata:'xx'}).function(data){ angular.foreach(data, function (value, key) {                     var filename = value.filename;                     var contenttype = value.mediatype;                     try {                          var bytearray = new uint8array(value.content);                         var blob = new blob([bytearray], { type: contenttype });                          saveas(blob, filename);                     } catch (ex) {                         console.log(ex);                     }                 }); } } 

i not sure how use ng-webworker above scenario download files background process. want ui should interactive , user can on page.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -