Skip to content
This repository was archived by the owner on Sep 15, 2021. It is now read-only.

Commit 5b99cd4

Browse files
committed
Add default options to deviceOrientation.js
1 parent b0a043d commit 5b99cd4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/plugins/deviceOrientation.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
angular.module('ngCordova.plugins.deviceOrientation', [])
55

66
.factory('$cordovaDeviceOrientation', ['$q', function ($q) {
7-
7+
var defaultOptions = {
8+
frequency: 3000 // every 3s
9+
};
810
return {
911
getCurrentHeading: function () {
1012
var q = $q.defer();
@@ -21,6 +23,7 @@ angular.module('ngCordova.plugins.deviceOrientation', [])
2123
watchHeading: function (options) {
2224
var q = $q.defer();
2325

26+
var options = angular.extend(defaultOptions, options);
2427
var watchID = navigator.compass.watchHeading(function (result) {
2528
q.notify(result);
2629
}, function (err) {

0 commit comments

Comments
 (0)