I want to log something when a user clicks on a tab. How can I do this?
Unfortunately (ionSelect) is not the answer as this is only triggered when the tab is selected, so when the execution of all the previous code is already done. I need an event as near as possible to the action the user triggers.
I get suspicious when people ask questions about minutia of framework event timing. In my experience, that sort of thing is not very reliable. Can you not design things so that you can be a bit more flexible as far as precise sequencing goes?
I hate tabs because there’s always some weird issue like this. But maybe you could solve this completely differently. Have a provider subscribe to NavController.viewWillEnter() and take the desired step whenever a (different) root tabs page is the newly entered page.
I’ll put it this way: if you have to worry about this, then you’re doing too much (synchronous) heavy work in constructors and lifecycle events, or your templates are overcomplicated. If everything you do in there is asynchronous and straightforward, the framework overhead should be imperceptible.