Currently, I'm working on an AngularJS web application that requires scanning a package from a mobile device. To achieve this functionality, I am utilizing BridgeIt.
Unfortunately, the code I've written in Angular doesn't seem to be functioning as expected.
HTML CODE:
<input id="inp" />
<button id="scan" ng-click="scan()"> Scan </button>
JS CODE:
// Inside Angular controller
$scope.scan = function() {
bridgeit.scan('scan', 'window.scan');
}
// In global scope
window.scan = function(event) {
alert(event.data);
}
Result: While BridgeIt successfully scans the QR/bar code, it is not returning the value as intended.