Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Accidentally unsubscribe event with menu

$
0
0

@john33john33 wrote:

Background
A ionic app with menu and two pages (Home and list).

Home page subscribes an event on ionViewWillEnter
and unsubscribes it on ionViewWillUnload.

Correct situation:
Start app with Home and the event subscribed.
If toggle menu and click List from Home, the event unsubscribed.
Re-enter Home and the event subscribed.

Wrong situation:
App started with Home and event subscribed.
Toggle menu > click Home >
Console:
event subscribed
event unsubscribed

Result is the event unsubscribed on Home page.

Desire situation
Enter Home(from other page / re-enter from menu) > subscribe event once.
Leave Home(to other page / re-load same page from menu) unsubscribe event once.

Playground
ionic-menu

I 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

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>