Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

163
Views
how to convert JavaScript code document.querySelector into Angular9?

I have code which is written in JavaScript code as let input= document.querySelector("#input"); and

input.addEventListener('click', function() {
    canvas.getContext('2d').drawImage(input, 0, 0, canvas.width, canvas.height);
    let image_data_url = canvas.toDataURL('image/jpeg');
});

I want to write this code in angular how can I convert and use this code in angular9 project anyone please help me

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

the best way to do it is like this:

<input (click)="clickOnMyInput($event)">

and in your .ts file

clickOnMyInput(e){
    this.canvas.getContext('2d').drawImage(e.target, 0, 0, this.canvas.width, this.canvas.height);
    let image_data_url = this.canvas.toDataURL('image/jpeg');
}

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!