I have a custom component used for showing some stats retrieved from an API in 1 second intervals. This component has a subscription that has to be “turned off” when leaving any page that contains this component. On pages I can have a ionWillLeave() function that I can use for this, but I need to do the same inside my custom Component.
I thought that just extending from Ion would lead my components to listen to page events, but I guess I’m not understanding something and clearly missing something else. I’m currently solving the problem using events, but I would like to do it the “Ionic way”, as in the alert-component
Any suggestion on how to achieve this?