$cordovaDeviceOrientation .getCurrentHeading() .then(function (orientation) { // success, use orientation }, function (err) { // error });
var options = { frequency: 3000 }; var watch = $cordovaDeviceOrientation.watchHeading(options); watch.promise.then( function () { /* unused */ }, function (err) { // error }, function (motion) { // motion with constant updates });
// use watch.watchID from watchAccelaration() $cordovaDeviceOrientation .clearWatch(watch.watchID) .then(function (result) { // success }, function (err) { // error });