My barcode scanner plugin Typescript file
scanBarCode() {
this.barcodeScanner.scan().then(barcodeData => {
this.scannedbarCode = barcodeData.text;
}, (err) => {
console.log('Error: ', err);
});
}
clearbar(){
this.scannedbarCode= null;
}
My HTML side of barcode scanner
<ion-item *ngIf='item.datatype == "barcode"'>
<ion-label floating><b>{{item.label}}</b></ion-label>
<button ion-button small item-right color="primary" (click)="scanBarCode()">Scan Barcode</button>
<button ion-button small item-right color="danger" (click)="clearbar()">Clear</button>
<ion-input type="text" value={{scannedbarCode}}></ion-input>
</ion-item>
If i scanned barcode one the same value comes on the second barcode value.Is there is any to avoid these using anything inside ionic expression.The barcode field is generated dynamically according to data type “barcode”.
If two field comes with data type "barcode " it will generate two fields like above.The problem is the is if i scanned one field the value apply simultaneously to all other field
