My current issue involves utilizing angular-file-saver to export a table into an xlsx file. The table is contained within a div specified by $document[0].getElementById('exportable').innerHTML.
To achieve this, I am creating a Blob object which is then passed as a parameter to FileSaver.
vm.blobData = new Blob([$document[0].getElementById('exportable').innerHTML], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
});
var config = {
data: vm.blobData,
filename: vm.scoreboardtype + 'scoreboard' + vm.scoreboarddate + '.xls'
};
FileSaver.saveAs(config);
However, upon executing the code, I encounter the following error message: "Data argument should be a blob instance".
Is there a solution you can provide for this issue?
Thank you,