- «appLayout»: Perhaps the main event, this is certainly as a result of a direction changes, windows resize, web page positioning inside the DOM, or something that could invalidate the design of the webpage. Bind to the celebration and put any format relevant rule for the webpage in right here.
- «appShow»: discharged anytime the user navigates to this web page. This might fire several times in the event the user navigates to some other page and finally comes back.
- «appHide»: Fired when the consumer navigates away from these pages. Remember that this does not suggest your page shall be ruined, for instance in the event after user navigates toward another webpage and certainly will possibly keep returning.
- «appBack»: discharged once the consumer is actually visit this website here navigating backwards during the heap from this web page.
- «appForward»: Fired whenever the individual try navigating ahead in the pile with this web page.
- «appBeforeBack»: discharged if the user is going to browse backwards into the stack. This routing is generally terminated by going back untrue inside the handler for your occasion (comparable to just how window.onbeforeunload work).
- «appReady»: this is exactly successfully called the first time an appShow is called on webpage. It offers the additional bonus on making sure screen.onload was called, making it ideal for network-bound initialization laws.
- «appDestroy»: Fired once the case on the page is just about to be damaged entirely. This ordinarily occurs when the individual features finished navigating backwards from the web page.
Upon deterioration, you should unbind events that have been bound outside the scope of this page to permit the JavaScript rubbish enthusiast to accomplish their job.
Routing pile
As talked about before, App.load helps make duplicate from the picked page, produces a controller because of it, and gift suggestions they on the individual.
If a navigation was attempted while a person is ongoing the routing will likely be queued to perform after the present one finishes.
If the first button are clicked App.load(‘page2’) will instantly get called. Another button is similar but also provides page arguments to-be pass along ( App.load(‘contact’, < firstName>) )
Right back stack
While you navigate from webpage to document App.js mantains a brief history of this content you have been to having the ability to navigate to them. App.back will be the conceptual reverse of App.load in this navigates back to the last webpage weight (destroying the current web page if the navigation completes).
Another usual action to take with a back option is label it on the basis of the previous web page. App.js provides a convenience for immediately obtaining the back button be named after the webpage it will trigger.
Select a typical page
A standard use-case for content would be to offer a way the individual to pick some content or information to be used from the contacting page. This is completed using the next:
Changes
Automatically App.js will make an effort to changeover between content utilizing whatever match most readily useful together with the system that application is operating on. Eg on apple’s ios the brands of one’s pages will fall while diminishing
There are lots of built in transitions each telephone call to «App.load» can establish which change to make use of immediately (overriding the defaults).
Restore bunch
Because App.js is aware of their navigation stack and ways to make pages, in addition it gives the power to immediately restore the users session to in which they certainly were the past times it was shut. Providing this particular feature requires this following idiom:
Below try a typical example of how to best restore the stack if last program was a student in the last 5 minutes.
Comments are closed