I am currently working on an application that allows users to browse and download phone call recordings.
One key feature of this application is a table that displays the recordings along with relevant information using *ngFor. Each row in the table includes a checkbox for selecting the recording for download. I have managed to log the links to the sample mp3 files, but I'm stuck on how to enable the actual downloading of these mp3s.
My goal is to achieve this functionality using Typescript without relying on jQuery.
<table>
<thead>
<tr>
<th>
<input type="checkbox" [checked]="isAllChecked()" (change)="checkAll($event)"> </th>
<th>Date</th>
<th>Time</th>
<th>Duration</th>
<th>Calling Number</th>
<th>Called Number</th>
<th> </th>
</tr>
</thead>
<tbody>
<tr *ngFor="let entry of recordingsList">
<td>
<input type="checkbox" [(ngModel)]="entry.isSelected"> </td>
<td>{{entry.date}}</td>
<td>{{entry.time}}</td>
<td>{{entry.duration}}</td>
<td>{{entry.callingNumber}}</td>
<td>{{entry.calledNumber}}</td>
<td>
<button (click)="openPlayer(entry)" class="play-button"><i class="material-icons">play_arrow</i></button>
</td>
</tr>
</tbody>
</table>
-
// Trigger download for selected recordings
downloadSelected() {
let isSelected = this.recordingsList.filter(x => x.isSelected);
isSelected.forEach(x => console.log(x.audio));
}
-
Your input and help on this matter would be greatly appreciated.