Back button issue. Previous page is not triggerring any methods

I was in home page, and then i went to another page to add a record. And then i am coming back to home page. In home page i need to show the record(s) added.

In add page, i tried with ion-back-button


I also tried to use a custom button

    <ion-buttons slot="start">
      <ion-button (click)="changeRoute()">Back</ion-button>

And the route change function is as below

changeRoute() {

But still, in the home page, none of the below methods are triggering.

ionViewWillEnter() {
  ionViewDidLoad() {
  ionViewWillLeave() {
  ionViewDidLeave() {
  ionViewWillUnload() {
  ionViewDidEnter() {

My ionic version info is as below

Any help would be appreciated.

My advice would be to stop abusing lifecycle events to deal with stale data concerns.

how do you reload the data then?

“Reload the data” is too vague for me to say much constructive about, aside from the detailed code example given in the link.

I want to simply reload the data by making an api call. I don’t want to make it complex.

My point is less about how to reload the data than when, and I’m saying that page lifecycle events are a bad way to determine when. If you want a user action to initiate this, I would add an explicit refresh button or a component like ion-refresher.

That’s one way. But i don’t want the user to go and refresh himself. When he come back to same page, we should just fetch all records and show him. Basically it should be seamless.

This makes no sense to me. If new records are being added by some external forces, I see no difference between the user sitting on the page and the user going somewhere else and coming back to that page. I dislike polling strategies for mobile apps because of battery concerns, but polling is another way to handle this, which (if you follow the general Observable approach) can be seamlessly integrated.

So I fundamentally disagree that “leaving a page and coming back to it” constitutes a reasonable trigger for refreshing anything, especially compared to something like pull-to-refresh.

Perhaps, however, you will find some other kindred soul who agrees with you to continue this conversation with.