Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 230087

ngOnInitworks hectic with lazy loading

$
0
0

I checked, it is called consistently. Meaning that when it’s called on a given component, I can expect ngOnInit will be called when I navigate back to it, but if it is not called, ngOnInit won’t be either.

What’s interesting is that I found out it’s building a tree of some sort.

In the footer menu there are anchors with different routes, let’s mark them with A, B, C.

Navigating in alphanumeric order doesn’t destroy components, while navigating backwards does.
So if I navigate A > B > C > A
The call order is
A - ngOnInit
B - ngOnInit
C - ngOnInit
C - ngOnDestroy, B - ngOnDestroy simultaneously


Viewing all articles
Browse latest Browse all 230087

Trending Articles



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