Angular 5 and ExcelJS

雨燕双飞 提交于 2019-12-04 19:14:57

Seems the npm example is given in node definitions and you are using typescript, a quick workaround would be to install node types so that you needn't find equivalent typescript syntax everytime, ie npm install --save-dev @types/node, with this done, node definitions would be added to the IDE and would also resolve compilation issues.

Now your file could be like this:

var Excel = require('exceljs');


export class ExcelHandler {
   public testExcelJs() {


      var workBook = new Excel.Workbook();
      var workSheet = workBook.addWorksheet('my-worksheet');
   }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!