I have the following structure
Home > Page 1
My Page 1 every 10 seconds performs an http request. I realized that when I move from Page 1 to Home, I continue to make requests.
I would like to know how I can remove the stack as soon as I leave the page.
I've tried:
ionViewWillLeave(){
this.navController
.push(HomePage)
.then(() => {
// first we find the index of the current view controller:
const index = this.viewCtrl.index;
// then we remove it from the navigation stack
this.nav.remove(index - 1);
});
}
To change pages I use the following function:
rotaHome() {
this.nav.setRoot(HomePage);
}