Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48983

When does ngOnInit run? Serious question

$
0
0
  1. ngOnInit runs once during component initialization and then the page is stored on the stack. So only ionViewWillEnter and ionViewDidEnter fire after that when navigating back to the page.

  2. If I close the app on my iOS or Android device and then open it again ngOnInit runs. So obviously the stack is cleared when the app is closed.

  3. If I leave the app for a few days and come back?
    Sometimes it seems that ngOnInit runs although I can’t be 100% sure. Is there a time limit and then the page expires or something or the app is closed by the OS after a period of not being used?

I reload some data on the ngOnInit and I would like to know in which situations this reloads.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48983

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>