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

Commit

Permalink
Side menu
Browse files Browse the repository at this point in the history
  • Loading branch information
mlynch committed Jun 3, 2014
1 parent 41f33f0 commit 0753ec3
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 6 deletions.
1 change: 1 addition & 0 deletions demo/app/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ function ap {
cordova plugin add org.apache.cordova.$1
}

ap console
ap device
ap camera
ap vibration
Expand Down
17 changes: 16 additions & 1 deletion demo/app/www/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ angular.module('starter.controllers', [])
.controller('AppCtrl', function($scope) {
$scope.plugins = [
{ name: 'Camera', slug: 'camera' },
{ name: 'Geolocation', slug: 'geolocation' }
{ name: 'Geolocation', slug: 'geolocation' },
{ name: 'Accelerometer', slug: 'accelerometer' }
];
})

Expand Down Expand Up @@ -38,4 +39,18 @@ angular.module('starter.controllers', [])
$scope.lng = position.coords.longitude;
});
};
})

.controller('AccelCtrl', function($scope, $cordovaAccelerometer) {
console.log('Accel');
$scope.toggleTrack = function() {
$cordovaAccelerometer.watchAcceleration().then(function(resp) {
}, function(err) {
}, function(data) {
console.log('Data', data)
$scope.x = data.x;
$scope.y = data.y;
$scope.z = data.z;
});
};
});
2 changes: 1 addition & 1 deletion demo/app/www/lib/ngCordova/ng-cordova.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ angular.module('ngCordova.plugins.accelerometer', [])

navigator.accelerometer.watchAcceleration(function(result) {
// Do any magic you need
q.resolve(result);
q.notify(result);
}, function(err) {
q.reject(err);
}, options);
Expand Down
2 changes: 1 addition & 1 deletion demo/app/www/lib/ngCordova/ng-cordova.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions demo/app/www/templates/plugins/accelerometer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<ion-view title="Accelerometer" ng-controller="AccelCtrl">
<ion-content padding="true">
<button class="button button-dark" ng-click="toggleTrack()">Toggle Track</button>
<br>
x: {{x}}
<br>
y: {{y}}
<br>
z: {{z}}
</ion-content>
</ion-view>
1 change: 1 addition & 0 deletions demo/app/www/templates/plugins/geolocation.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<ion-view title="Geolocation" ng-controller="GeolocationCtrl">
<ion-content padding="true">
<button class="button button-dark" ng-click="toggleTrack()">Toggle Track</button>
<br>
lat: {{lat}}
lng: {{lng}}
</ion-content>
Expand Down
2 changes: 1 addition & 1 deletion dist/ng-cordova.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ angular.module('ngCordova.plugins.accelerometer', [])

navigator.accelerometer.watchAcceleration(function(result) {
// Do any magic you need
q.resolve(result);
q.notify(result);
}, function(err) {
q.reject(err);
}, options);
Expand Down
Loading

0 comments on commit 0753ec3

Please sign in to comment.