You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by js...@apache.org on 2014/11/12 18:42:07 UTC

cordova-plugin-device-orientation git commit: CB-7977 Mention deviceready in plugin docs

Repository: cordova-plugin-device-orientation
Updated Branches:
  refs/heads/master 988b17f9f -> 41cdaeabd


CB-7977 Mention deviceready in plugin docs


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/commit/41cdaeab
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/tree/41cdaeab
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/diff/41cdaeab

Branch: refs/heads/master
Commit: 41cdaeabd5d6b25ea127875da9e914c4985908a1
Parents: 988b17f
Author: Josh Soref <js...@blackberry.com>
Authored: Thu Nov 6 17:09:52 2014 -0500
Committer: Josh Soref <js...@blackberry.com>
Committed: Thu Nov 6 17:09:52 2014 -0500

----------------------------------------------------------------------
 doc/index.md | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-device-orientation/blob/41cdaeab/doc/index.md
----------------------------------------------------------------------
diff --git a/doc/index.md b/doc/index.md
index b2474e7..b093ba6 100644
--- a/doc/index.md
+++ b/doc/index.md
@@ -24,6 +24,15 @@ that detects the direction or heading that the device is pointed, typically
 from the top of the device.  It measures the heading in degrees from 0 to
 359.99, where 0 is north.
 
+Access is via a global `navigator.compass` object.
+
+Although the object is attached to the global scoped `navigator`, it is not available until after the `deviceready` event.
+
+    document.addEventListener("deviceready", onDeviceReady, false);
+    function onDeviceReady() {
+        console.log(navigator.compass);
+    }
+
 ## Installation
 
     cordova plugin add org.apache.cordova.device-orientation


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org