Normally i can push and pop or setting the root page with the NavController with no complications. But in one case it didnt’t work anymore. I do a
this.navCtrl.setRoot(HomePage);
and get an Error: “Error in ./…SomePage class - caused by: …someData is undefined”.
SomePage actually needs someData to load and HomePage deletes someData, but why i get an error. ? I’m leaving SomePage and doesn’t need it anymore. Do i have to close it explicitly ?
Probably because the framework started HomePage before destroying SomePage. That’s asynchrony. You are guaranteed that things will eventually happen, not that they will happen in a particular order.
I still think it is a major design flaw to have any page throw an error that is effectively caused by circumstances outside of its control. How can you ever test this page? You need to make SomePage capable of handling the situation when someData is not available.