ionic platform
$ionicPlatform
$ionicPlatform is used to detect the current platform and, for example, overlay the Android back button in PhoneGap/Cordova.
Method
onHardwareBackButton(callback)
For platforms that have a hardware back button, you can bind to it using this method.
Parameters | Type | Details |
---|---|---|
callback | function | When this event occurs, the callback function is triggered. |
offHardwareBackButton(callback)
Remove the back button listening event.
Parameters | Type | Details |
---|---|---|
callback | function | The initially bound monitor function. |
registerBackButtonAction(callback, priority, [actionId])
Register the hardware back button action. When the button is clicked, only one action will be executed, so this method determines that the registered back button action has the highest priority.
For example, if a pull-up menu is already displayed, the back button should close the pull-up menu instead of returning to a page view or closing an open model.
Parameters | Type | Details |
---|---|---|
callback | function | Fired when the back button is clicked, if the monitor has the highest priority. |
priority | number | Only the highest priority will be executed. |
actionId (optional) | ##*
| The id specifies this action. Default: a random and unique id. |
Return value: Function, a triggered function, will log out backButtonAction.
ready([callback])When the device is ready, a callback function is triggered.
Type | Details | |
---|---|---|
(Optional) | function=
| The function triggered. |