我有一個頁面,我通過撥打:關閉模態頁
let profileModal = Modal.create(PopupPage);
this.nav.present(profileModal);
如何從我的PopupPage組分關閉此模式頁:
import { ElementRef } from '@angular/core';
import { Page } from 'ionic-angular';
@Page({
template: `
<ion-pane padding="" scroll="false">
<h2>Login with...</h2>
<p>Please select one of our social logins. We'll never post anything your name
<button class="button button-default button-full button-danger" style="background-color: #3b5998;"><i class="fa fa-facebook" aria-hidden="true"></i> Facebook</button>
<button class="button button-default button-full button-danger" style="background-color: #db3236;"><i class="fa fa-google" aria-hidden="true"></i> Google</button>
</ion-pane>`,
host: {
"(document: click)": "globalClicked($event)"
}
})
export class PopupPage {
constructor(private elmRef: ElementRef) {}
globalClicked(event) {
if(!this.eventTriggeredInsideHost(event)) alert('NOW');
}
eventTriggeredInsideHost(event) {
var current = event.target;
var host = this.elmRef.nativeElement.getElementsByTagName('ion-pane')[0];
do {
if (current === host) {
return (true);
}
current = current.parentNode;
} while (current);
return (false);
}
}
這是什麼問題? –
如何關閉它? – rakete