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.

Crash with Angular 4 Application

See original GitHub issue

Hi,

I’ve installed the lib in my project using NPM, and the problem is, when i write a line with the function html2pdf(...), my whole application crashes/not loading (stay on the “loading…” page), but there is no error, and the function is not even called on launch (called on a button click).

Any issues ?

Thanks.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Alescaycommented, Jun 6, 2018

Sure

const element = document.getElementById('elementToPrint');

html2canvas(element).then(function(canvas) {
  const pdf = new JsPdf();
  const img = canvas.toDataURL('image/png');
  pdf.addImage(img, 'PNG', 5, 4);
  const dateDuJ = new Date();
  const namePDF = 'MMMR_' + dateDuJ.valueOf();
  pdf.save(namePDF);
});
0reactions
jainvishal520commented, Jun 7, 2018

@Alescay Thankyou very much, it did work!

Read more comments on GitHub >

github_iconTop Results From Across the Web

import statement crashing an angular app despite installed ...
We have inherited a big Angular application, and have installed in it vega & vega-lite & vega-embed using npm and now we are...
Read more >
Angular - BugSplat
To collect errors and crashes in your Angular application, run the following command in terminal or cmd at the root of your project...
Read more >
Angular 4 Crash Course for Busy Developers - Code with Mosh
Angular 4 Crash Course for Busy Developers. Learn the Angular essentials, from setup to deployment, in 2 days. The fastest way to get...
Read more >
Why would angular cause my browser to crash? - Reddit
I'm on the reddit app so the code is a bit of a mess. Look at hyphens and camel case switching etc. And...
Read more >
Angular Crash Course - YouTube
... of Angular in this project-based crash courseVideo Sponsor:https://www.hostinger.com/traversymedia- Use the code TRAVERSYMEDIA for 10%.
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