This repository was archived by the owner on Sep 15, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ angular.module('starter.controllers', [])
1010 { name : 'Geolocation' , slug : 'geolocation' } ,
1111 { name : 'Device Motion' , slug : 'device-motion' } ,
1212 { name : 'Device Orientation' , slug : 'device-orientation' } ,
13+ { name : 'Flashlight' , slug : 'flashlight' } ,
1314 { name : 'Statusbar' , slug : 'status-bar' } ,
1415 { name : 'Vibration' , slug : 'vibration' } ,
1516 { name : 'Barcode' , slug : 'barcode' } ,
@@ -107,6 +108,15 @@ angular.module('starter.controllers', [])
107108 } ;
108109} )
109110
111+ . controller ( 'FlashlightCtrl' , function ( $scope , $cordovaFlashlight ) {
112+ $scope . on = function ( ) {
113+ $cordovaFlashlight . switchOn ( ) ;
114+ } ;
115+ $scope . off = function ( ) {
116+ $cordovaFlashlight . switchOff ( ) ;
117+ } ;
118+ } )
119+
110120. controller ( 'VibrationCtrl' , function ( $scope , $cordovaVibration ) {
111121 $scope . data = {
112122 vibrateTime : 500
Original file line number Diff line number Diff line change 1+ < ion-view title ="Flashlight " ng-controller ="FlashlightCtrl ">
2+ < ion-content scroll ="false " padding ="true ">
3+ < button ng-click ="on() " class ="button button-energized "> On</ button >
4+ < button ng-click ="off() " class ="button button-dark "> Off</ button >
5+ </ ion-content >
6+ </ ion-view >
You can’t perform that action at this time.
0 commit comments