I'm trying to make the app (cordova + onsen) read a QR code and when reading open the link contained in the QR, but instead of opening the link it tries to open a page in the root of the application (file: // android_asset / www / barcode.result).
In the code I just added var ref = window.open('barcode.result', '_blank');
the rest is working normally, it just does not open the link contained in the QR.
Follow my barcode controller code:
app.controller('barcodeController', function( $scope ) {
$scope.barcode = {
'result': '',
'format': '',
'cancelled': ''
};
$scope.startScanner = function() {
cordova.plugins.barcodeScanner.scan(function (result) {
$scope.$apply(function() {
$scope.barcode = {
'result': result.text,
'format': result.format,
'cancelled': result.cancelled
}
var ref = window.open('barcode.result', '_blank'); //parte acrescentada
});
},
function (error) {
alert("Scanning failed: " + error);
}
)};
});