xxxxxxxxxx
<igx-column field="memberId" [sortable]="false" header="Download" [filterable]="false" width="100px">
<ng-template igxCell let-cell="cell">
<!-- -->
<mat-icon svgIcon="mat_outline:file_download"
(click)="downloadInvoice(cell.value,true)"></mat-icon>
</ng-template>
</igx-column>
downloadInvoice(memberId: string, isDownload: boolean): void {
// const rowData: MemberPreEnrollmentAttachment = this.attachmentDetailsGrid.getRowByIndex(data).data;
// let model = new BlobInformationModel();
// model.fileName = data.substring(data.indexOf('/') + 1)
// model.containerName = data.substring(0, data.indexOf('/'))
this.attachmentService.getInvoiceBlobUri(memberId).subscribe({
next: (res) => {
if (isDownload) {
let link = document.createElement('a');
link.style.display = "none"; // because Firefox sux
document.body.appendChild(link); // because Firefox sux
link.href = res;
link.download = "Premium";
link.click();
document.body.removeChild(link); // because Firefox sux
}
else {
const dialogRef = this.dialog.open(HpsDocumentViewerComponent, {
width: '50%',
data: res
});
}
}
});
}