ionic Platform
$ IonicPlatform
$ IonicPlatform used to detect the current platform, as well as covering the Android back button PhoneGap / Cordova in.
method
onHardwareBackButton(callback)
Hardware platform back button, you can use this method to bind to it.
parameter | Types of | Detail |
---|---|---|
callback | function | When this event occurs, the trigger callback function. |
offHardwareBackButton(callback)
Remove the back button event listener.
parameter | Types of | Detail |
---|---|---|
callback | function | Monitor functions were originally bound. |
registerBackButtonAction(callback, priority, [actionId])
Register Hardware back button action. When you click the button, only one action is taken, this method determines the action registered back button has the highest priority.
For example, if a pull-up menu is already displayed, the Back button should close the pop-up menu, instead of returning a page view or close an open model.
parameter | Types of | Detail |
---|---|---|
callback | function | When you click the Back button is triggered, if the monitor has the highest priority. |
priority | number | Only the highest priority will be executed. |
actionId (Optional) | * | The id specified this action. Default: a random and unique id. |
Return value: function, a function is triggered, it will write-off backButtonAction.
ready([callback])
Equipment is ready, trigger a callback function.
parameter | Types of | Detail |
---|---|---|
callback (Optional) | function= | Trigger function. |
Returns: promise the object, the object is constructed are resolved successfully.