Hello community,
im sitting over 4 hours and trying any possible suggestion, but no one works for me.
Im including follow cordova plugin "https://github.com/wildabeast/BarcodeScanner.git".
Im also including the ngCordova.min.js file and declare it in the module.
So far so good, but when im inject $cordovaBarcodeScanner, then it tells me that it is an object and my intellj detect the "scan" function, but when i execute it, it tells me the error as described in the title.
That's what i do in the controller:$ionicPlatform.ready(function () {
$cordovaBarcodeScanner.scan(function (e) {
alert("OK");
}, function (err) {
console.log(err)
});
});
Heindent preformatted text by 4 spacesre is the full stacktrace the Logcat prints me out:[INFO:CONSOLE(25642)] "TypeError: Cannot read property 'scan' of undefined
at Object.scan (file:///android_asset/www/js/ng-cordova.min.js:7:5751)
at file:///android_asset/www/js/controllers.js:10:32
at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:53329:19
at Object.ionic.Platform.ready (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:2135:9)
at Object.self.ready (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:53327:26)
at vm.scan (file:///android_asset/www/js/controllers.js:9:22)
at new <anonymous> (file:///android_asset/www/js/controllers.js:17:8)
at invoke (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17762:17)
at Object.instantiate (file:///android_asset/www/lib/ionic/js/ionic.bundle.js:17770:27)
at file:///android_asset/www/lib/ionic/js/ionic.bundle.js:22326:28", source: file:///android_asset/www/lib/ionic/js/ionic.bundle.js (25642)
I also tried to call it via cordova.plugins.barcodescanner, but this wont work either....can anyone help me?