-1
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, it continues to carry out the requisitions.
I wonder how I can remove from the stack as soon as I exit the page.
I tried to:
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);
}
Try to make an observable unsubscribe that is making the unwanted onDestroy requests
– Eduardo Vargas
I tried on onDestroy, when changing page, in several different places, but the requests continue, I got only through the way I published the answer
– veroneseComS