mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
test(actionsheet): open modal from actionsheet
This commit is contained in:
@ -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>'
|
||||
|
Reference in New Issue
Block a user