Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

195
Vistas
how do I add a page link in the ok button of Swal in Angular?

This is my html file

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

This is my ts file

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

So, when I click on the OK(which in here is success), I want user to redirect to the Cart Page of the site. How do I add a link?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Just make use of JavaScript promises. Put the then method after swal function. We do not need to use timer features. For example:

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

Thank you

about 4 years ago · Juan Pablo Isaza Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda