@lonangel wrote:
Hi,
I'm trying to get the phonegap-plugin-barcodescanner to work with ionic 2.
This is the code I'm trying to use.import {Page, NavController} from 'ionic-framework/ionic';
import {ItemDetailsPage} from '../item-details/item-details';@Page({
templateUrl: 'build/pages/getting-started/getting-started.html'
})export class GettingStartedPage {
nav:NavController;constructor(nav:NavController) { this.nav = nav; } scan() { var me = this; if (window.cordova) { cordova.plugins.barcodeScanner.scan((imageData) => me.nav.push(ItemDetailsPage, { itemid: imageData.text } ) , (error) => alert("An error happened -> " + error) ); } }
}
The Idea was to read the barcode and send the value to another page to show some details about the item.
Trying it on my Nexus 5 I don't see any errors on the adb.Best Regards,
Duarte
Posts: 4
Participants: 3