ngOnInit is not invoked when tab is clicked


#1

I have a tabs app. When I click on a tab, is does not invoked the ngOnInit on the page associated with that tab.

I think this relates to:

but I don’t understand how to implement the fix in that post.

Please help.


#2

are you use ionViewWillEnter?


#3

Good question given I only mentioned ngOnInit. ionViewWillEnter does not get invoked either.

Update to my previous reply: I just created a fresh tabs app from ionic and ionViewWillEnter does get invoked. I’m not sure what is wrong with my app. It’s very simple and I only created it a couple weeks ago.

I’ll investigate on my own and follow up if I can resolve it.


#4

ionViewWillEnter does work. Thank you @YAsh0011!


#5

ionViewWillLeave sometimes triggers after my template. I need ngOnInit