From e053c945eed95cef39d844b248a3f47d1ca1b42e Mon Sep 17 00:00:00 2001 From: Ibrahim Hadeed Date: Tue, 8 Mar 2016 13:29:03 -0500 Subject: [PATCH] docs(plugin): add docs --- src/plugins/deviceorientation.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/plugins/deviceorientation.ts b/src/plugins/deviceorientation.ts index 1f193f65..b9d9c749 100644 --- a/src/plugins/deviceorientation.ts +++ b/src/plugins/deviceorientation.ts @@ -47,7 +47,20 @@ export interface CompassOptions { * ```` * * @usage - * ```js + * ```ts + * // Get the device current compass heading + * DeviceOrientation.getCurrentHeading().then( + * data => console.log(data), + * error => console.log(error) + * ); + * + * // Watch the device compass heading change + * var subscription = DeviceOrientation.watchHeading().subscribe( + * data => console.log(data) + * ); + * + * // Stop watching heading change + * subscription.unsubscribe(); * ``` */ @Plugin({