Reputation: 332
I'm trying to display a QR_CODE. I get an alert that I have an object, but I can't find the function or property that displays the actual QR_CODE.
My code goes this way:
BarcodeScanner.encode (BarcodeScanner.Encode.TEXT_TYPE, 'Hello World')
.then ((success) => {
alert (success);
}), (error) => {
alert (error);
}
I get this alert:
Any ideas? My guess was to alert (success.QR_CODE)
, but y get a message of undefined
.
Upvotes: 0
Views: 39
Reputation: 332
I figured the answer.
What I had to do is to declare a property inside my class. For me it's called urlImage
. Then, inside the encode function:
BarcodeScanner.encode (BarcodeScanner.Encode.TEXT_TYPE, 'Hello World')
.then ((success) => {
this.urlImage = success.file;
}), (error) => {
alert (error);
}
Then, in my html code:
<img src="{{imageUrl}}"/>
And that's it.
Upvotes: 1