I’m trying to show an alert if there is a missing value in a previous alert used as a floating modal, but after setting the second alert in the nav with this.nav.present(secondAlert) the first one is lost, but i don’t know if an alert can be pushed in the nav or another way to do it. Here is what i have:
let alert = Alert.create({
title: 'New Task',
inputs: [
{
name: 'task',
placeholder: 'Task',
type: 'string'
},
{
name: 'date',
placeholder: 'Date',
type: 'date'
},
{
name: 'place',
placeholder: 'Place',
type: 'string'
}
],
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
},
{
text: 'Add',
handler: data => {
if(data.task != ''){
alert.dismiss();
}else{
let alert= Alert.create({
title: 'Some error',
buttons: [{
text: 'Acept',
handler: () => {
a.dismiss();
}
}]
});
// now present the alert on top of all other content
this.nav.present(a);
}
}
}
]
});
this.nav.present(alert);