mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
docs(demos): close popup, actionSheet, modal when page leaves
Closes #311
This commit is contained in:
@ -50,7 +50,14 @@ class ModalsContentPage {
|
||||
template: '<ion-nav [root]="rootView"></ion-nav>'
|
||||
})
|
||||
export class ModalsPage {
|
||||
constructor() {
|
||||
constructor(modal: Modal) {
|
||||
this.rootView = ModalsFirstPage;
|
||||
this.modal = modal;
|
||||
}
|
||||
onPageWillLeave() {
|
||||
let modal = this.modal.get();
|
||||
if (modal) {
|
||||
modal.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user