question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I use html2canvas with Angular 2?

See original GitHub issue

Can someone please explain how to use html2canvas properly with Angular 2?

It can be installed with npm install html2canvas but it does not contain any TypeScript code. @niklasvh , will you provide a version we can easily use with Angular 2?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:6

github_iconTop GitHub Comments

2reactions
adrianoweadcommented, Aug 24, 2017

I’m using with Ionic2 + Angular 2.

import * as html2canvas from 'html2canvas';

And use like:

myClickFunction( event: any ){
  html2canvas( event.target )
    .then((canvas) => {
      console.log( canvas );
    })
    .catch(err => {
      console.log("error canvas", err);
    });
}
2reactions
Tarek-Adracommented, Feb 14, 2017

Check this answer Here

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Angular 2 - Import html2canvas - Stack Overflow
I have installed html2canvas on my angular 2 project using npm install html2canvas --save . If I now go to any file and...
Read more >
Angular Html2canvas - StackBlitz
Starter project for Angular apps that exports to the Angular CLI.
Read more >
Getting Started - html2canvas
You can install html2canvas through npm or download a built release. npm. npm install html2canvas. import html2canvas from ' ...
Read more >
Angular2+ jsPDF and html2canvas File Generation
To generate pdf files in Angular2+ (specifically angular4), first install jspdf $ npm install jspdf. Then install typings for jspdf,
Read more >
Angular 13 jsPDF & Html2Canvas Project to Export ... - YouTube
Get the full source code of application ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found