本文整理匯總了TypeScript中@ionic/angular.ModalController類的典型用法代碼示例。如果您正苦於以下問題:TypeScript ModalController類的具體用法?TypeScript ModalController怎麽用?TypeScript ModalController使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ModalController類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: presentModal
async presentModal() {
const modal = await this.modalController.create({
component: DoacaoaddPage,
componentProps: { value: 123 }
});
return await modal.present();
}
示例2: abrirModal
async abrirModal(){
const modal = await this.modalCtrl.create({
component: ModalInfoPage,
componentProps: {
nombre: 'Jorge',
pais: 'MĂŠxico'
}
});
await modal.present();
const { data } = await modal.onDidDismiss();
console.log('Retorno del Modal: ', data);
}
示例3: sendNodeInfo
sendNodeInfo() {
let addNodeNameMsg = "Please add the name of the node";
if (this.nodeName === undefined || this.nodeName.replace(/\s/g, "") === "") {
this.presentToast(addNodeNameMsg);
} else {
const data = {
id: this.nodeName.replace(/\s/g, ""),
name: this.nodeName.replace(/\s/g, ""),
data: { weight: +this.nodeWeight },
position: { x: 0, y: 0 }
};
this.modalController.dismiss(data);
}
}
示例4: closeModal
async closeModal() {
const onClosedData: string = "Wrapped Up!";
await this.modalController.dismiss(onClosedData);
}
示例5: clickMe
async clickMe() {
const modal = await this.modalController.create({
component: ModalPageToPresent
});
return modal.present();
}
示例6: close
close() {
this.modalController.dismiss(null, undefined);
}