sweetalert2 / ngx-sweetalert2

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

Will the library be upgraded to v17 of Angular? #254

Closed dev-garcia closed 10 months ago

dev-garcia commented 10 months ago

In Angular projects on version 16, upgrading to v17 through ng, it works normally, but when we start a new project on v17 and install the sweet alert 2 library, it doesn't work as it should.

dev-garcia commented 10 months ago

[pt-br] era apenas erro de sintaxe, funcionando normalmente!

HTML


<button (click)="showAlert()" class="button">Mostrar Alerta 2</button>

TS

import { CommonModule } from '@angular/common';
import Swal from 'sweetalert2';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [CommonModule],
  templateUrl: 'app.component.html',
  styleUrls: ['./app.component.css'],
})
export class AppComponent {
  title = 'teste-angular-dezessete';

  showAlert() {
    Swal.fire({
      title: 'Erro!',
      text: 'Erro ao executar',
      icon: 'error',
      confirmButtonText: 'Fechar',
    });
  }
}