As per official document :
const modal = await modalController.create({...});
const { data } = await modal.onDidDismiss();
console.log(data);
See official docs link
As other answers stated, now onDidDismiss() also returns a promise. So you can follow how documentation advises you to capture data or do something like this, its just another syntax basically:
async openModal() {
const modal = await this.modal.create({ component: UploadPage });
modal.onDidDismiss().then((data) => {
console.log(data)
});
return await modal.present();
}
actual data will be inside data.data in this case.








![Cannot read property ‘toLowerCase’ of undefined [ERROR] An error occurred while running subprocess cordova.](https://blog.rahulbhutani.com/wp-content/uploads/2020/12/ionic-enable-xcode-permissions-banner-218x150.png)









