A global object that's used in Onsen UI. This object can be reached from the AngularJS scope.
Signature | Description |
---|---|
ready(callback) | Method used to wait for app initialization. The callback will not be executed until Onsen UI has been completely initialized. |
bootstrap([moduleName, [dependencies]]) | Initialize Onsen UI. Can be used to load Onsen UI without using the ng-app attribute from AngularJS. |
enableAutoStatusBarFill() | Enable status bar fill feature on iOS7 and above. |
disableAutoStatusBarFill() | Disable status bar fill feature on iOS7 and above. |
findParentComponentUntil(name, [dom]) | Find parent component object of dom element. |
findComponent(selector, [dom]) | Find component object using CSS selector. |
setDefaultDeviceBackButtonListener(listener) | Set default handler for device back button. |
disableDeviceBackButtonHandler() | Disable device back button event handler. |
enableDeviceBackButtonHandler() | Enable device back button event handler. |
isReady() | Returns true if Onsen UI is initialized. |
compile(dom) | Compile Onsen UI components. |
isWebView() | Returns true if running inside Cordova. |
createAlertDialog(page, [options]) | Create a alert dialog instance from a template. |
createDialog(page, [options]) | Create a dialog instance from a template. |
createPopover(page, [options]) | Create a popover instance from a template. |
Method used to wait for app initialization. The callback will not be executed until Onsen UI has been completely initialized.
Name | Type | Description |
---|---|---|
callback | Function | Function that executes after Onsen UI has been initialized. |
Initialize Onsen UI. Can be used to load Onsen UI without using the ng-app
attribute from AngularJS.
Returns: An AngularJS module object.
Name | Type | Description |
---|---|---|
moduleName | String | AngularJS module name. |
dependencies | Array | List of AngularJS module dependencies. |
Enable status bar fill feature on iOS7 and above.
Disable status bar fill feature on iOS7 and above.
Find parent component object of dom
element.
Returns: Component object. Will return null if no component was found.
Name | Type | Description |
---|---|---|
name | String | Name of component, i.e. 'ons-page'. |
dom | Object|jqLite|HTMLElement | $event, jqLite or HTMLElement object. |
Find component object using CSS selector.
Returns: Component object. Will return null if no component was found.
Name | Type | Description |
---|---|---|
selector | String | CSS selector |
dom | HTMLElement | DOM element to search from. |
Set default handler for device back button.
Name | Type | Description |
---|---|---|
listener | Function | Function that executes when device back button is pressed. |
Disable device back button event handler.
Enable device back button event handler.
Returns true if Onsen UI is initialized.
Returns: Will be true if Onsen UI is initialized.
Compile Onsen UI components.
Name | Type | Description |
---|---|---|
dom | HTMLElement | Element to compile. |
Returns true if running inside Cordova.
Returns: Will be true if the app is running in Cordova.
Create a alert dialog instance from a template.
Returns: Promise object that resolves to the alert dialog component object.
Name | Type | Description |
---|---|---|
page | String | Page name. Can be either an HTML file or an |
options | Object | Parameter object. |
options.parentScope | Object | Parent scope of the dialog. Used to bind models and access scope methods from the dialog. |
Create a dialog instance from a template.
Returns: Promise object that resolves to the dialog component object.
Name | Type | Description |
---|---|---|
page | String | Page name. Can be either an HTML file or an |
options | Object | Parameter object. |
options.parentScope | Object | Parent scope of the dialog. Used to bind models and access scope methods from the dialog. |
Create a popover instance from a template.
Returns: Promise object that resolves to the popover component object.
Name | Type | Description |
---|---|---|
page | String | Page name. Can be either an HTML file or an |
options | Object | Parameter object. |
options.parentScope | Object | Parent scope of the dialog. Used to bind models and access scope methods from the dialog. |