create modal in ionic 2 angular 2
from parent page
signIn() {
let data = { 'foo': 'bar' };
let modal = this.modalCtrl.create(LoginPage);
modal.present();
modal.onDidDismiss( (data : any) => {
//console.log(data.loggedin);
this.navCtrl.push(TabsPage);
});
//modal.onDidDismiss(() => {
//console.log("abcdef");
//});
}
inside modal page
setTimeout(() => {
//this.navCtrl.pop();
// Close modal
let data = { 'loggedin': 'yes' };
this.viewCtrl.dismiss(data);
}, 500);
from parent page
signIn() {
let data = { 'foo': 'bar' };
let modal = this.modalCtrl.create(LoginPage);
modal.present();
modal.onDidDismiss( (data : any) => {
//console.log(data.loggedin);
this.navCtrl.push(TabsPage);
});
//modal.onDidDismiss(() => {
//console.log("abcdef");
//});
}
inside modal page
setTimeout(() => {
//this.navCtrl.pop();
// Close modal
let data = { 'loggedin': 'yes' };
this.viewCtrl.dismiss(data);
}, 500);
Comments
Post a Comment