fumito-ito / angularjs-barcodeScanner

An anglar.js wrapper around window.plugins.barcodeScanner for Phonegap/Cordova plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Undefined and New version of scanner declaration

dparadox opened this issue · comments

Hello,

I have a problem with the declaration of the factory, there is a problem for $digest already in progress.

Before You set deferred, You should check if $digest already in progress.

if(!$rootScope.$$phase ) {
//$digest or $apply
}

$rootScope.$apply( function () {
deferred.reject(barcodeScanner_msgs['errors.barcodeScanner.undefined']);
});

You have to declare scanner object like this:

var scanner = cordova.require("com.phonegap.plugins.barcodescanner.BarcodeScanner");

Thank you

I think I'm having the same issue. I'm not exactly sure how to fix it. @estebanlopezlumenup do you have a patch?