Javascript 在单个进度条中显示下载多个文件的进度

Javascript 在单个进度条中显示下载多个文件的进度,javascript,angularjs,algorithm,file,cordova,Javascript,Angularjs,Algorithm,File,Cordova,我正在为Android平台构建一个ionic应用程序。我正在使用cordova的FileTransfer插件下载文件。我可以下载多个文件,但不能为所有并发下载显示单个进度条 在一个进度条中显示多个文件的进度的正确方式是什么?下面是我的功能代码供参考: 函数通过在循环中调用单个文件下载函数来下载多个文件 函数下载一个文件 解决方案是在视图中传递歌曲id <li ng-repeat="song in songsList"> <progress id="{{song.id}}" ma

我正在为Android平台构建一个ionic应用程序。我正在使用cordova的FileTransfer插件下载文件。我可以下载多个文件,但不能为所有并发下载显示单个进度条

在一个进度条中显示多个文件的进度的正确方式是什么?下面是我的功能代码供参考:

函数通过在循环中调用单个文件下载函数来下载多个文件

函数下载一个文件


解决方案是在视图中传递歌曲id

<li ng-repeat="song in songsList">
<progress id="{{song.id}}" max="100" value=""></progress>
</li>

解决方案是在视图中传递歌曲id

<li ng-repeat="song in songsList">
<progress id="{{song.id}}" max="100" value=""></progress>
</li>
<li ng-repeat="song in songsList">
<progress id="{{song.id}}" max="100" value=""></progress>
</li>
function(progress){
document.getElementById(song.id).value(Math.ceil((progress.loaded/progress.total)*100));
}