Sunday, April 14, 2019

Onsen ons object

Difference between document init and ons.ready:

https://onsen.io/v2/guide/fundamentals.html#the-ons-object

The ons JavaScript object is globally available, and has several useful methods and properties.
For example, ons.ready(callback) method can be used to wait for app initialization. Specifically, this function waits until “DOMContentLoaded” and Cordova’s “deviceready” events are fired. This is useful, for instance, to know when is safe to make calls to Cordova APIs.

No comments:

Post a Comment