I have been trying to understand the differences between the Page events in Nativescript, the events I am trying to look into are loaded
, navigatingTo
and navigatedTo
. What I have seen, the 3 of them will be fired everytime you navigate to the Page. What I do not understand is in which order they are executed. I know that navigatingTo
fires first than navigatedTo
, that makes sense, but what about loaded
?
Is loaded
being fired every time you navigate to the page or just for the first time you navigate to the page?
Is there any event that only executes the first time you navigate to the page? If the app is closed or went to the background and then resumed, it will fire again, of course.
Thanks!!!
Supose you are in "Old page" and navigate to "New page", the sequence of events is:
When the app is open, there is no "Old page", so the sequence is:
If app is closed, the app only triggers its unloaded event (you put it in background to close it, or power off the device...)
If you run the app in background, the page triggers its unload event, and when you resume the app, the page triggers its loaded event.
This is my experience, it may not agree with 'reality'
(Updated: See also: {N} v7 Page Events)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With