I have a homepage and a comment page. When I close the modal (comment page) , I want the homepage to refresh so that It can update the Comment Counts. I can refresh the homepage by calling ionViewWillEnter()
function.
My code:
homepage
async openModal() {
const modal = await this.modalController.create({
component: CommentsPage,
componentProps: {
postId: this.postID
}
});
modal.onDidDismiss(() => { this.ionViewWillEnter(); }); //Error: Expected 0 arguments, but got 1.ts(2554)
return await modal.present();
}
Comment Page:
async closeModal() {
this.modalController.dismiss();
}