mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +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({
|
@Page({
|
||||||
@ -31,9 +31,10 @@ class E2EPage {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: 'No close',
|
text: 'Open Modal',
|
||||||
handler: () => {
|
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
|
// returning false does not allow the actionsheet to be closed
|
||||||
return false;
|
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({
|
@App({
|
||||||
template: '<ion-nav [root]="root"></ion-nav>'
|
template: '<ion-nav [root]="root"></ion-nav>'
|
||||||
|
Reference in New Issue
Block a user