ionic-team / ng-cordova

OBSOLETE: Please move to Ionic Native https://github.com/ionic-team/ionic-native
https://github.com/ionic-team/ionic-native
MIT License
3.48k stars 1.05k forks source link

Unfortunately app stopped working in android #1189

Open itsrnd opened 8 years ago

itsrnd commented 8 years ago

Hello Guys,

   I have written the following code, but when my android 4.4 device reach at **"$cordovaBarcodeScanner.scan().then(function(imageData)"** my app gives error **"Unfortunately app stopped working"**. Any body can help? 

exampleApp.controller("ExampleController",function($scope,$cordovaBarcodeScanner){ $scope.scanBarcode = function(){ alert("In function"); $cordovaBarcodeScanner.scan().then(function(imageData){ alert("In function1"); //alert("Format = "+imageData.format); document.getElementById('customer_bar_id').value = imageData.text; alert("In function2"); $('#customer_bar_id').show(); alert("In function"); $('#customer_bar_search').show(); },function(error){ alert("An error happened = "+error); }); } });

vitaliy-bobrov commented 8 years ago

But why you using jQuery? This is angular, so you can use built-in jqLite or native dom api.