mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
Device motion and orientation
This commit is contained in:
@ -17,7 +17,7 @@ import {NativePlugin} from '../plugin';
|
|||||||
* })
|
* })
|
||||||
*
|
*
|
||||||
* watch.clear() // to stop watching
|
* watch.clear() // to stop watching
|
||||||
```
|
* ```
|
||||||
*/
|
*/
|
||||||
@NativePlugin({
|
@NativePlugin({
|
||||||
name: 'Device Motion',
|
name: 'Device Motion',
|
||||||
|
@ -4,6 +4,19 @@ import * as util from 'ionic/util';
|
|||||||
import {NativePlugin} from '../plugin';
|
import {NativePlugin} from '../plugin';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Respond to device orientation changes (compass).
|
||||||
|
*
|
||||||
|
* @usage
|
||||||
|
* ```js
|
||||||
|
* let watch = DeviceOrientation.watchHeading();
|
||||||
|
* watch.source.subscribe((data) => {
|
||||||
|
* // data.alpha is the compass heading
|
||||||
|
* })
|
||||||
|
*
|
||||||
|
* watch.clear() // to stop watching
|
||||||
|
* ```
|
||||||
|
*/
|
||||||
@NativePlugin({
|
@NativePlugin({
|
||||||
name: 'Device Orientation',
|
name: 'Device Orientation',
|
||||||
platforms: ['ios', 'android', 'web'],
|
platforms: ['ios', 'android', 'web'],
|
||||||
|
Reference in New Issue
Block a user