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

Commit

Permalink
Flashlight in demo
Browse files Browse the repository at this point in the history
  • Loading branch information
mlynch committed Jul 10, 2014
1 parent 56d17a8 commit d3b40f3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions demo/app/www/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ angular.module('starter.controllers', [])
{ name: 'Geolocation', slug: 'geolocation' },
{ name: 'Device Motion', slug: 'device-motion' },
{ name: 'Device Orientation', slug: 'device-orientation' },
{ name: 'Flashlight', slug: 'flashlight' },
{ name: 'Statusbar', slug: 'status-bar' },
{ name: 'Vibration', slug: 'vibration' },
{ name: 'Barcode', slug: 'barcode' },
Expand Down Expand Up @@ -107,6 +108,15 @@ angular.module('starter.controllers', [])
};
})

.controller('FlashlightCtrl', function($scope, $cordovaFlashlight) {
$scope.on = function() {
$cordovaFlashlight.switchOn();
};
$scope.off = function() {
$cordovaFlashlight.switchOff();
};
})

.controller('VibrationCtrl', function($scope, $cordovaVibration) {
$scope.data = {
vibrateTime: 500
Expand Down
6 changes: 6 additions & 0 deletions demo/app/www/templates/plugins/flashlight.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<ion-view title="Flashlight" ng-controller="FlashlightCtrl">
<ion-content scroll="false" padding="true">
<button ng-click="on()" class="button button-energized">On</button>
<button ng-click="off()" class="button button-dark">Off</button>
</ion-content>
</ion-view>

0 comments on commit d3b40f3

Please sign in to comment.