- “appLayout”: possibly the key occasion, this will be brought on by an orientation change, screen resize, webpage location inside the DOM, or something that could invalidate the format of the webpage. Bind to this celebration and put any design relevant code to suit your webpage in here.
- “appShow”: discharged when an individual navigates to this page. This might shoot many times if consumer navigates to some other web page and ultimately returns.
- “appHide”: Fired when the user navigates away from this page. Observe that it doesn’t suggest your web page is damaged, for example in the case if the user navigates forward to another page and will possibly come back.
- “appBack”: Fired after individual is navigating backwards in pile with this web page.
- “appForward”: Fired after user is navigating onward within the stack using this page.
- “appBeforeBack”: Fired once the individual is about to navigate backwards during the pile. This routing is generally terminated by coming back false into the handler for your show (similar to how windows.onbeforeunload work).
- “appReady”: this will be successfully known as first time an appShow is known as from the webpage. It offers the additional added bonus on ensuring that window.onload happens to be called, rendering it useful for network-bound initialization signal.
- “appDestroy”: discharged whenever incidences of webpage is about to be damaged totally. This usually takes place when the user features completed navigating backwards through the page.
Upon destruction, it is important to unbind activities which were likely outside the extent in the web page to allow the JavaScript trash collector accomplish its job.
Navigation pile
As mentioned previously, App.load helps make duplicate of the selected webpage, creates an operator because of it, right after which provides they with the user.
If a routing try tried while you’re happening the routing will be queued to do following present one completes.
When the basic switch was clicked App.load(‘page2’) will automatically see also known as. Another option is similar but supplies page arguments to-be transfer ( App.load(‘contact’, < firstName>) )
Back once again heap
While you navigate from webpage to document App.js mantains a brief history associated with pages you’ve been to with the ability to navigate to them. App.back will be the conceptual reverse of App.load because navigates back again to the previous web page burden (destroying current page when the routing completes).
Another usual action to take with a straight back option is label they according to the earlier web page. App.js supplies a convenience for automatically obtaining straight back option be called following the web page it is going to cause.
Choose a web page
A standard use-case for pages is always to give a way for any individual to select some content or information used about contacting page. This could be accomplished utilising the next:
Transitions
Automagically App.js will try to transition between pages making use of whatever fits well with the program that the application try running on. As an example on iOS the titles of your own pages will slip while diminishing aside, simulating the indigenous iOS changeover preferences.
There are numerous built in transitions and every telephone call to “App.load” can specify which change to use right (overriding the non-payments).
Correct pile
Because App.js is aware of their navigation heap and ways to construct pages, additionally, it provides the capability to instantly restore the people session to in which they were the past opportunity it actually was sealed. Permitting this feature needs this following idiom:
Below is actually a good example of how exactly to only restore the stack if the final treatment was in the final five minutes.