sweetalert2 / ngx-sweetalert2

Declarative, reactive, and template-driven SweetAlert2 integration for Angular
MIT License
652 stars 94 forks source link

Sweet alert over dialog primeng #247

Closed edisonwerle closed 1 year ago

edisonwerle commented 1 year ago

How to make sweet alert open confirmation over a primeng dialog?

I'm calling confirmation like this :

private showConfirm( titulo: string, mensagem: string, icon: SweetAlertIcon, textoButtomConfirm: string, textoButtomCancela: string): Promise {

return Swal.fire({
  title: titulo,
  text: mensagem,
  icon: 'question',
  showCancelButton: true,
  confirmButtonColor: '#3085d6',
  cancelButtonColor: '#d33',
  confirmButtonText: textoButtomConfirm,
  cancelButtonText: textoButtomCancela
})
.then((result) => {
  if (result.isConfirmed) {
    return true;
  }
  return false;
});

}