Import JSZip in Angular 2 project

前端 未结 2 1792
温柔的废话
温柔的废话 2020-12-10 02:09

I am having troubles while importing the JSZip library in my Angular 2 project. I followed the following steps in order to change the project configuration:

1 - Inst

相关标签:
2条回答
  • 2020-12-10 02:40

    There is a typo and it should be:

    import * as JSZip from 'jszip';
    let zipFile: JSZip = new JSZip();
    
    0 讨论(0)
  • 2020-12-10 03:03

    For those who want to know how it ended, the problem was in the import. The following is the correct import:

    import * as JSZip from 'jszip';
    

    Then, it is used as follows:

    let zipFile: JSZip = new JSZip();
    
    0 讨论(0)
提交回复
热议问题