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

197
Views
¿Cómo agrego un enlace de página en el botón Aceptar de Swal en Angular?

Este es mi archivo html

 <button (click)="pay()">Add to Cart</button>

Este es mi archivo ts

 pay(){ Swal.fire( `Congratulations!!🤩`, `<h3>The item has been added to the cart!!<h3>`, 'success'); }

Entonces, cuando hago clic en Aceptar (que aquí es un éxito), quiero que el usuario redirija a la página del carrito del sitio. ¿Cómo agrego un enlace?

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

0

Simplemente haga uso de las promesas de JavaScript. Ponga el método entonces después de la función swal. No necesitamos usar funciones de temporizador. Por ejemplo:

 swal({ title: 'Request Delivered', text: 'You can continue with your search.', type: 'success' }).then(function() { window.location = "redirectURL"; })

Gracias

about 4 years ago · Juan Pablo Isaza Report

0

pay(){ Swal.fire( `Congratulations!!🤩`, `<h3>The item has been added to the cart!!<h3>`, 'success').then(() => { this.router.navigate(['/yourCartPage']); }) }
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!