Ionic Life cycle vs Angular Life Cycle

Which life cycle which should be used Ionic or angular ?

Ionic -

Angular -

you can use both life cycle

in which sequence should it be used ? and when is it preferable .

basically ionic life cycle is used in mobile for view rendering and it is preferable
and when you use inappbrowser or third party api and you want to initialize then you also can use angular life cycle
but i suggest to use ionic life cycle event.:+1:

I have a need to subscribe and unsubscribe , which is the ideal place to do it ,in respect to ionic ?

i use ionViewWillEnter() to subscribe data from api beacuse i have to refresh data whever my any page become active and ionViewWillLeave for unsubscribe

1 Like

And if I don’t want data to be refresh everytime, is ionviewdidload() the ideal place to subscribe for the data ?

yes it is if you subscribe data only one time :+1: