exceljs: Angular Material crashes
Hello all,
I’m trying to use this lib with Angular 8 and Angular Materia, and below is my method
async exportExcel(jsonData: any[], headers: TableColumn[], fileName: string, config?: ExcelRowConfiguration ) {
// create workbook and worksheet
let workbook = new Workbook();
let worksheet = workbook.addWorksheet(fileName);
if (!config) {
config = new ExcelRowConfiguration();
}
//config.fonts = excel title config
//config.alignment = excel header config
this.generateFileTitle(fileName, worksheet, config);
this.generateHeaderRow(headers, worksheet, config);
this.generateDataRows(jsonData, worksheet, headers);
await this.generateExcelFile(workbook, fileName);
}
For some reason when the code is like above, my material components acquire stranger behaviors.
For example: I click to open a mat-expansion-panel and it expands only if I click in other area, I have to click twice to export table, and other stranger behaviors.
But when I comment the method’s body everything work fine.
Is known any issue with Angular Material Components and ExcelJS?
About this issue
- Original URL
- State: open
- Created 5 years ago
- Comments: 20
Ok so far i’ ve changed my pollyfills.ts like this:
After i’ ve upgraded both Angular & exceljs i’ ll remove this exceljs import & make the module lazy load again.
For now i hope to it’ ll work like this.
Thank you all.
I cannot reproduce this error anymore on
v4.1.1Inside lib/exceljs.browser.js is a line:
Inside this module is something that causes this problem. I do not really have the time do pinpoint the location. But it does not seem to be a problem in this library. And the code still works if I remove it, so I leave it so someone else to find a better solution for this bug.