test(actionsheet): open modal from actionsheet

This commit is contained in:
Adam Bradley
2016-02-27 20:50:57 -06:00
parent af8537b726
commit 66af6ff3a0

View File

@ -1,4 +1,4 @@
import {App, Page, ActionSheet, NavController} from 'ionic-angular';
import {App, Page, ActionSheet, Modal, NavController, ViewController} from 'ionic-angular';
@Page({
@ -31,9 +31,10 @@ class E2EPage {
}
},
{
text: 'No close',
text: 'Open Modal',
handler: () => {
console.log('do not close clicked');
let modal = Modal.create(ModalPage);
this.nav.present(modal);
// returning false does not allow the actionsheet to be closed
return false;
@ -90,6 +91,27 @@ class E2EPage {
}
@Page({
template: `
<ion-toolbar>
<ion-buttons>
<button (click)="dismiss()">Close</button>
</ion-buttons>
<ion-title>Modal</ion-title>
</ion-toolbar>
<ion-content padding>
Hi, I'm Bob, and I'm a modal.
</ion-content>
`
})
class ModalPage {
constructor(private viewCtrl: ViewController) {}
dismiss() {
this.viewCtrl.dismiss();
}
}
@App({
template: '<ion-nav [root]="root"></ion-nav>'