`
})
class ModalFirstPage {
constructor(nav: NavController) {
this.nav = nav;
}
push() {
let page = ModalSecondPage;
let params = { id: 8675309, myData: [1,2,3,4] };
let opts = { animation: 'ios-transition' };
this.nav.push(page, params, opts);
}
dismiss() {
this.nav.rootNav.pop();
}
openActionSheet() {
let actionSheet = ActionSheet.create({
buttons: [
{
text: 'Destructive',
role: 'destructive',
handler: () => {
console.log('Destructive clicked');
}
},
{
text: 'Archive',
handler: () => {
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',
role: 'cancel',
handler: () => {
console.log('cancel this clicked');
}
}
]
});
this.nav.present(actionSheet);
}
}
@Page({
template: `
Second Page Header