mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
Device motion and orientation
This commit is contained in:
@ -17,7 +17,7 @@ import {NativePlugin} from '../plugin';
|
||||
* })
|
||||
*
|
||||
* watch.clear() // to stop watching
|
||||
```
|
||||
* ```
|
||||
*/
|
||||
@NativePlugin({
|
||||
name: 'Device Motion',
|
||||
|
@ -4,6 +4,19 @@ import * as util from 'ionic/util';
|
||||
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({
|
||||
name: 'Device Orientation',
|
||||
platforms: ['ios', 'android', 'web'],
|
||||
|
Reference in New Issue
Block a user