@john33john33 wrote:
Background
A ionic app with menu and two pages (Homeandlist).
Homepage subscribes an event onionViewWillEnter
and unsubscribes it onionViewWillUnload.Correct situation:
Start app withHomeand the event subscribed.
If toggle menu and clickListfromHome, the event unsubscribed.
Re-enterHomeand the event subscribed.Wrong situation:
App started withHomeand event subscribed.
Toggle menu > clickHome>
Console:
event subscribed
event unsubscribedResult is the event unsubscribed on
Homepage.Desire situation
EnterHome(from other page / re-enter from menu) > subscribe event once.
LeaveHome(to other page / re-load same page from menu) unsubscribe event once.Playground
ionic-menuI expect the enter and unload come with pair.
If re-entering same page, unload should runs before enter.
However, it’s not the case.
Please suggest a way for proper (un)subscribe event in ionic
Thanks.
Posts: 1
Participants: 1