I would really, really love to use this in Typescript but after several hours of futile effort, I am giving up and finding another, probably less capable, package that I can run in the browser and work with from Typescript. Guys, a trivial example of how to do this would be enormously helpful. What is really frustrating is that this is obviously very close to working but either I am clueless or some trivial example is needed. I am not the first to fall thru this crack.
Ok, to make this easier for the next person,
1) after npm installing exceljs
2) use the following import:
import * as ExcelJs from 'exceljs/lib/exceljs.browser.js';
See #238 - I made a type definition file for it, but still a WIP, so not put into a PR yet...
I used this method (presented in #335)
In project tree:
npm install exceljs --save
In the component.ts:
import * as ExcelJs from 'exceljs/dist/exceljs.min.js';
Do not try to do dependency injection into constructor() (it requires proper .d.ts). Instead just grab the ExcelJs:
var workbook = new ExcelJs.Workbook();
Works for me.
P.S. When I was trying var workbook = new ExcelJs.Workbook(); with import ExcelJs from 'exceljs;, app crashed.
Most helpful comment
I used this method (presented in #335)
In project tree:
npm install exceljs --saveIn the component.ts:
import * as ExcelJs from 'exceljs/dist/exceljs.min.js';Do not try to do dependency injection into constructor() (it requires proper .d.ts). Instead just grab the ExcelJs:
var workbook = new ExcelJs.Workbook();Works for me.
P.S. When I was trying
var workbook = new ExcelJs.Workbook();withimport ExcelJs from 'exceljs;, app crashed.