Hi,
I have some problem to clean properly my subscription to event when I use the back button. It seems that the ionViewWillLeave is not called in this case.
Here is my flow :
I enter page 1.
I enter page 2.
In page 2 I do something like that :
ionViewWillEnter()
{
…
this.events.subscribe(‘tabs:refresh’, this._onRefresh)
…
}
ionViewWillLeave() {
this.events.unsubscribe(‘tabs:refresh’, this._onRefresh)
}
I press the previous button (the browser one) which make me go back to page 1. The IonViewWillLeave of page 2 is not called.
When I go in page 2 I will subscribe again to my event. The problem is nothing has cleaned my previous subscribe so I end up having the function called twice when this events is triggered.
I am not able to find a function that is called when using the brower previous button. Is there one ?
I tried to call this.events.unsubscribe(‘tabs:refresh’, this._onRefresh) in my view constructor to clean my mess but it doesn’t seems to work either.
Thanks,