{"action":"closed","issue":{"url":"https://api.github.com/repos/driftyco/ng-cordova/issues/592","labels_url":"https://api.github.com/repos/driftyco/ng-cordova/issues/592/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ng-cordova/issues/592/comments","events_url":"https://api.github.com/repos/driftyco/ng-cordova/issues/592/events","html_url":"https://github.com/driftyco/ng-cordova/issues/592","id":55365049,"number":592,"title":"ngCordova DeviceOrientation","user":{"login":"pcrombach","id":419239,"avatar_url":"https://avatars.githubusercontent.com/u/419239?v=3","gravatar_id":"","url":"https://api.github.com/users/pcrombach","html_url":"https://github.com/pcrombach","followers_url":"https://api.github.com/users/pcrombach/followers","following_url":"https://api.github.com/users/pcrombach/following{/other_user}","gists_url":"https://api.github.com/users/pcrombach/gists{/gist_id}","starred_url":"https://api.github.com/users/pcrombach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pcrombach/subscriptions","organizations_url":"https://api.github.com/users/pcrombach/orgs","repos_url":"https://api.github.com/users/pcrombach/repos","events_url":"https://api.github.com/users/pcrombach/events{/privacy}","received_events_url":"https://api.github.com/users/pcrombach/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-24T09:34:19Z","updated_at":"2015-02-07T05:04:55Z","closed_at":"2015-02-07T05:04:55Z","body":"In the doc for $cordovaDeviceOrientation:\r\n\r\n    $cordovaDeviceOrientation.clearWatch(watch)\r\n      .then(function(result) {\r\n        // Success!\r\n      }, function(err) {\r\n        // An error occurred\r\n      });\r\n\r\n  }, false);\r\n\r\n$cordovaDeviceOrientation.clearwatch is not a promise\r\n\r\nif it should be a promise:\r\n\r\nclearWatch: function (watchID) {\r\nvar q = $q.defer();\r\nnavigator.compass.clearWatch(watchID);\r\nq.resolve();\r\nreturn q.promise;\r\n}\r\nOr the example in the doc should not use method .then.\r\n\r\nBTW why is there in watchHeading a method???:\r\n\r\n        q.promise.clearWatch = function (id) {\r\n          navigator.compass.clearWatch(id || watchID);\r\n        };\r\n"}}