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

161
Views
¿Cómo convertir el código JavaScript document.querySelector en Angular9?

Tengo un código que está escrito en código JavaScript como let input= document.querySelector("#input"); y

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

Quiero escribir este código en angular, ¿cómo puedo convertir y usar este código en el proyecto angular9, alguien, por favor, ayúdeme?

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

0

la mejor manera de hacerlo es así:

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

y en su archivo .ts

 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!