Device motion and orientation

This commit is contained in:
Max Lynch
2015-09-28 13:58:06 -05:00
parent 4c9c32a899
commit c044323e03
2 changed files with 14 additions and 1 deletions

View File

@ -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',

View File

@ -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'],