Apologies my last post got submitted accidently
I am trying to create a qr code and insert the image created by a qrcode library into the rad side drawer
Following is the code
HTML
<RadSideDrawer #drawer [transition]="sideDrawerTransition" selectionBehavior="None" height="100%">
<StackLayout tkDrawerContent class="sidedrawer-left">
<ScrollView row="0" col="2">
<StackLayout class="sidedrawer-content">
<Image #qrCode height="100" width="100" ></Image>
</StackLayout>
</ScrollView>
</StackLayout>
<StackLayout tkMainContent class="bg-primary" height="100%" >
</StackLayout>
</RadSideDrawer>
TS file
@ViewChild('qrCode') qrCode: ElementRef;
//this is the code I run where i try to generate a qr code and assign to the image tag.
this
.ngZone.runOutsideAngular(() => {
var
ZXing = require(
'nativescript-zxing'
);
var
zx =
new
ZXing();
var
imageSource = require(
'image-source'
);
var
img = zx.createBarcode({encode: user.PhoneNumber, height: 100, width: 100, format: ZXing.QR_CODE});
this
.qrCode.nativeElement.imageSource = imageSource.fromNativeSource(img); }
the above code does not work and gives me an error saying qrCode is undefined.
When I move the image tag and place it in the tkMainContent stacklayout I can see the QR code image.
Any ideas how to resolve this issue
Thanks