mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
test(alert): dismiss alert, then run nav.pop()
This commit is contained in:
@@ -206,7 +206,7 @@ class ModalFirstPage {
|
||||
buttons: [
|
||||
{
|
||||
text: 'Destructive',
|
||||
style: 'destructive',
|
||||
role: 'destructive',
|
||||
handler: () => {
|
||||
console.log('Destructive clicked');
|
||||
}
|
||||
@@ -217,9 +217,26 @@ class ModalFirstPage {
|
||||
console.log('Archive clicked');
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Go To Root',
|
||||
handler: () => {
|
||||
// overlays are added and removed from the root navigation
|
||||
// find the root navigation, and pop this alert
|
||||
// when the alert is done animating out, then pop off the modal
|
||||
this.nav.rootNav.pop().then(() => {
|
||||
this.nav.rootNav.pop();
|
||||
});
|
||||
|
||||
// by default an alert will dismiss itself
|
||||
// however, we don't want to use the default
|
||||
// but rather fire off our own pop navigation
|
||||
// return false so it doesn't pop automatically
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
text: 'Cancel',
|
||||
style: 'cancel',
|
||||
role: 'cancel',
|
||||
handler: () => {
|
||||
console.log('cancel this clicked');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user