IONIC 4 IonWillLeave from tabs to page not triggered

I need to unsubscribe something, as a lot of documentation said, it best to do it in ionWillLeave. but the event doesn’t triggered.

I tried using navController.navigteRoot like suggested here but it also doesn’t fire the ionWillLeave.

any suggestion what am I should do ?


Why do you feel the need to do this unsubscribing? If it’s to avoid leaking memory, which is the most typical reason, then I would do it in ngOnDestroy and not fret if that isn’t called when you think it might be.

1 Like

ah yes, i forgot about ngOnDestroy will be called if we do navController.navigateRoot , thank You!