Closed dev-garcia closed 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',
});
}
}
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.