Personal I'm 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 in the Alert PopUp? I want the user to be redirected to HomePage. When the button is there in the html I know how to do it, but in Alert I have no idea, I have already looked at documentation and nothing.
Mybuttonin.html
<buttonclass="p4" ion-item (click)="showConfirm()"><img class="img4"
src="../../assets/imgs/logout.png">Sair</button>
My button in .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();
}