How to remove a page completely?
I have used this:
this.navCtrl.removeView(this.viewCtrl);
this
this.viewCtrl.dismiss();
and this:
const index = this.viewCtrl.index;
this.navCtrl.remove(index);
with all the above page disappear from the view but I need to completely destroy that page from (stack/navigation or whatever you call it) so I can invoke that page again.
What actually I am doing is, I have an event listener, on this event fire I am showing that page, With all above methods that page disappear from the view but when event is fired again I see page appears multiple times. it opens as many times it was opened last time +1.
So if that page was open 5 time before, it will show 6 times again on next event fire.
EDIT:
ok I did something and i think its not that issue: so for testing I added this script:
let that = this;
setInterval(function () {
let getviews = that.navCtrl.getViews();
console.log(getviews);
}, 2000);
it shows me correctly pages in view when close it , but when event is fire again , it open that page multiple times