node.js - Angular 2 - Import html2canvas -


i have installed html2canvas on angular 2 project using npm install html2canvas --save. if go file , write import * html2canvas 'html2canvas' gives error:

cannot find module 'html2canvas' 

my package file looks this:

{   ...   "scripts": {     ...   },   "dependencies": {     ...     "html2canvas": "^0.5.0-beta4",     ...   },   "devdependencies": {     ...   } } 

the file on i'm trying import html2canvas is:

import { injectable } '@angular/core'; import * jspdf 'jspdf'; import * html2canvas 'html2canvas';  @injectable () export class pdfgeneratorservice {    ... } 

since angular2 uses typescript, need install typescript definition files module.

it can installed @types (if exists). if doesn't can create own definition file , include in project.


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -