[SOLVED] Page don't refresh after pop with new data


#1

Hello everyone.
I currently have 2 pages. One with a count of the rows with errors and the other one is a grid with all errors.
I have a button that change something in the database and after that, the app return to the page with the error’s count but the view don’t refresh and I keep seeing the initial count.

In the button I have this.

presentLoadingDefault() {
    let loading = this.loadingCtrl.create({
      content: 'Please wait...'
    });

    loading.present();

    setTimeout(() => {
      this.presentAlert();
      loading.dismiss();
     
      this.navCtrl.insert(1, HomePage);
      this.navCtrl.popToRoot();

    }, 2000);
  }

Thanks!

#2

I just found the solution.
Using ionViewWillEnter() {
console.log(‘Runs when the page is about to enter and become the active page.’);
}

Thanks


#3

where did you put
ionViewWillEnter() {
console.log(‘Runs when the page is about to enter and become the active page.’);
}
?
can you provide some code to explain better please? I’ve the same problem