NathanaelA / nativescript-zxing

ZXing for NativeScript
Other
15 stars 22 forks source link

zxing undefined. #1

Closed Thabangtg closed 7 years ago

Thabangtg commented 8 years ago

Hello NathanaelA.

I saw your repo demo as a solution to what i need to implement for my practice, but then after i have followed all the instructions i got an error about zxing undefined on the declaration.

function loaded(args){ var zx = new ZXing(); var data = pageData.set('voucherNumber',voucher.id); var qr_code = zx.createBarcode({ encode: data, height: 100, width: 100, format: ZXing.QR_CODE }); var page = args.object; var voucher = page.navigationContext; pageData.set('amount',voucher.balance); pageData.set ('img', qr_code); page.bindingContext = pageData; }

Help if there's something im missing. Thank You NathanaelA

NathanaelA commented 8 years ago

Two reasons this can happen...

  1. I assume you did a var ZXing = require('nativescript-zxing'); before that code, correct? 2.. Do a FULL rebuild; you must do a full rebuild when adding a plugin. If you don't it will give you the undefined error.
Thabangtg commented 8 years ago

from my experience, Automatically when there is a new plugin installed and you tns livesync android --emulator it usually rebuilds it. Let me rebuild and ill get back to you. Thank you.

Thabangtg commented 8 years ago

Hello Nathanael.

It works just fine.

Thank you.