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

130
Views
Me gustaría usar un <script> en mi componente Angular, ¿cómo hago eso? (Mecanografiado, Angular12)

Este es el código que me gustaría usar en mi componente Angular:

 <form action="https://www.meu-site.com/processar-pagamento" method="POST"> <script src="https://www.mercadopago.com.br/integrations/v1/web-tokenize-checkout.js" data-public-key="ENV_PUBLIC_KEY" data-transaction-amount="100.00"></script></form>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Si tiene que cargar el script desde un sitio remoto, puede agregarlo a su archivo index.html, como lo haría en un sitio html normal.

índice.html

 <!-- get script from 3rd party site --> <script src="https://www.mercadopago.com.br/integrations/v1/web-tokenize-checkout.js" data-public-key="ENV_PUBLIC_KEY" data-transaction-amount="100.00"> </script>

Luego, para usar el script en su componente, debe declarar manualmente las variables/funciones exportadas para evitar errores de compilación de TS

** formComponent.ts**

 declare let web-tokenize-checkout: any; //declare the name of the global object you got from the script you added //use your script functionality, That part is really depends on how the script you imported works web-tokenize-checkout.doWhatEverYouNeed(....);
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!