How to reload the ion-page after pop()?

I have 2 pages Page1 and Page2. I have used this.nav.pop() in Page2 and it will pop the Page2 and Page1 will enable but i want to refresh the Page1. Thank you in advance.

1 Like

ionViewDidLoad() {

//Call Your Method
}

It will call everytime when your are entering into that page

1 Like

Thanks for your effort but it did not work
I have searched and reached a solution
We must use ionViewWillEnter() { }
Thanks you Again

3 Likes

Maybe :

  import { NavController } from 'ionic-angular';

  constructor( 
    private navCtrl: NavController
  ) {

  }

  ionViewWillEnter() {
    this.navCtrl.setRoot(this.navCtrl.getActive().component);
  }

You also have ionViewDidEnter().

1 Like

thank Dlazzy for your add
but this => this.navCtrl.setRoot(this.navCtrl.getActive().component);
will enter your page in loop View to the end.

Yes that’s right, I don’t have other solutions

1 Like

i used ionViewWillEnter(){}; but it not enter this lifecycle hook after pop().what should i do ?
i tried all the lifecycle hooks , but none of them work.
i have unauthorized 401 then the page login appear, after success in login i did pop for login page to let the same page that was before the login stay (let’s say page2) so page2 didn’t enter any of this lifecycle hooks

Please checkout my solution I’ve posted here: ionViewDidEnter is not invoked on leaving a pushed page

Maybe you can adapt it to your needs.

Hope it helps!

Cheers
Unkn0wn0x