Currently, I am in the process of developing a download function for an Android app using Angularjs based on this tutorial: Utilizing the Progress event in PhoneGap file transfers
Everything seems to be working efficiently as planned; I can successfully download the desired files using Web API. However, I have encountered an issue related to my use of ng-repeat in the code. The problem arises when the progress indicator runs only on the first item in the list, irrespective of the song selected.
To better illustrate the situation, here is a screenshot showcasing the issue: https://i.stack.imgur.com/rfz44.png
For instance, I attempted to download the third song, but the indicator displayed progress for the first song in the list.
The particular line of code in JavaScript that presents an issue involves the id 'status':
statusDom = document.querySelector("#status");
This id corresponds to an element within my HTML list:
<ion-list>
<div class="list" >
<a ng-repeat="nhac in songs" class="item item-thumbnail-left">
<h2>{{nhac.SongName}}</h2>
<p>{{nhac.Singer}}</p>
<button id="startDl" ng-click="download(nhac.SongId, nhac.SongName)">Download the Song</button>
<div id="status"></div>
</a>
</div>
</ion-list>
I am seeking guidance on how to modify the div id so that the progress indicator can accurately reflect the selected song during the download process.
I appreciate your assistance and understanding despite any language barriers.