@ice174 wrote:
I am new in ionic 4, I want to send the barcode result to the api then get the api response result from the api. How to do it?
Here is my code home.page.ts:export class HomePage { result: any; constructor( private barcodeScanner: BarcodeScanner, private http: HttpClient ) {} onScan() { this.barcodeScanner.scan().then(barcodeData => { return this.http.post('https://xxx/xxx/xxx', barcodeData).subscribe(data => { this.result= data; }); });here is my home.html
<ion-content> <ion-button (click)="onScan()">Scan</ion-button> <ion-label>{{result}}</ion-label> </ion-content>From this code no result show. Anyone can help me?
Posts: 1
Participants: 1