I have a requirement where I have refresh the contents of the current page onclick of the refresh button in the current page.I went through few websites but I am not quite clear about this functionality.Could anyone suggest me how to do this?
Onclick of your refresh button, you could call the page event method ionViewWillEnter()
From the official docs --> ionViewWillEnter() Runs when the page is about to enter and become the active page.
HTML
<button (click)="refreshPage()">Refresh Page</button>
Typescript
ionViewWillEnter(){
this.myDefaultMethodToFetchData();
}
refreshPage() {
this.ionViewWillEnter();
}
myDefaultMethodToFetchData(){
...Do Something, when the page opens...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With