I am trying to use jsPDF and jspdf-autotable in my Angular 5.2.0 project. My package.json is below (related parts):
\"dependencies\": {
...
\"jspdf\"
First you have declared .js
files in styles
property in angular-cli.json
, you should add them to scripts
. In the configuration that you have, you should add your jspdf
scripts to scripts
in angular-cli.json
, So:
"scripts": [
"../node_modules/jspdf/dist/jspdf.min.js",
"../node_modules/jspdf-autotable/dist/jspdf.plugin.autotable.js"
],
then you don't have to import any jspdf
to your component. declare var jsPdf: any
will be enough to use it.