I have installed one 3rd party module jsPDF with my angular app. The module works perfectly but I get an error in my console:
Cannot find module '../../../node_modules/jspdf/dist/jspdf.min.js'.
What I did:
- Install the module via npm:
npm install MrRio/jsPDF --save
- Import the module in my component:
import * as jsPDF from '../../../node_modules/jspdf/dist/jspdf.min.js';
- Then simply works with this module in my component.
Is something missing here?
apps[0].scriptsin yourangular-cli.jsonfile, which WebPack then bundles as if it were loaded with a<script>tag. If you do the latter, you can get at it by addingdeclare var jsPDF: any;in yoursrc/typings.d.tsor component. However, it looks like there are typings for jsPDF npmjs.com/package/@types/jspdf so you can include it; but you should be able toimport { jsPDF} from 'jspdf';