Change badge in ion-menu


I would like to update the value of a badge in a simple ion-menu. The ion-menu is defined in app.ts as per demo of the Ionic Team, but the value will change due to action in a different page.

I was thinking of using a service to to store and pass-on the value, but then I need to capture the open-menu event (menuToggle) in the app.ts to update the bound variable.

My question is how to capture the menuToggle action in app.ts and if this way of working is actually the best way to dynamically change presentation of menu items in ion-menu.

Alternatively, I could add a menu to each page (with similar layout), but that seems tedious and maybe give other issues. Or use the event mechanism to broadcast a change.

What would you do?



1 Like