0
I am making an App in Ionic and when the user presses the Exit button I was able to configure an Alert message, but how do I configure the "I Accept" button of the Alert Popup? I want the user to be redirected to the homepage. When the button is there in html I know how to do, but in Alert I have no idea, I’ve looked at documentation and nothing.
My button in . html
<button class="p4" ion-item (click)="showConfirm()"><img class="img4"
src="../../assets/imgs/logout.png">Sair</button>
My button on . ts
function showConfirm() {
const confirm = this.alertCtrl.create({
title: 'Deseja Realmente Sair ?',
message: 'Você será redirecionado para a PáginaPrincipal',
buttons: [
{
text: 'Não Aceito',
handler: () => {
console.log('Disagree clicked');
}
},
{
text: 'Aceito',
handler: () => {
console.log('Agree clicked');
}
}
]
});
confirm.present();
}