<qrcode></qrcode> error
Hi i got this error :
angular.js:13236 ReferenceError: qrcode is not defined
at setData (angular-qrcode.js:63)
at angular-qrcode.js:166
at angular.js:7955
at m.$eval (angular.js:16820)
at m.$digest (angular.js:16636)
at m.$apply (angular.js:16928)
at g (angular.js:11266)
at t (angular.js:11464)
at XMLHttpRequest.u.onload (angular.js:11405)
While put
Did you add monospaced.qrcode to your app’s dependencies?
Need 3 scripts
<script type="text/javascript" src="//monospaced.github.io/bower-qrcode-generator/js/qrcode.js"></script>
<script type="text/javascript" src="//monospaced.github.io/bower-qrcode-generator/js/qrcode_UTF8.js"></script>
<script type="text/javascript" src="//monospaced.github.io/angular-qrcode/angular-qrcode.js"></script>
And set module dependency.
angular.module('app', ['monospaced.qrcode']);
Thanks @shineum 👍
@monospaced
Doesn't work for me:
Uncaught ReferenceError: qrcode is not defined qrcode_UTF8.js on line 59
My import code:
import 'angular-qrcode/node_modules/qrcode-generator/js/qrcode.js';
import 'angular-qrcode/node_modules/qrcode-generator/js/qrcode_UTF8.js';
import 'angular-qrcode/angular-qrcode.js';
angular.module('app', ['monospaced.qrcode'])
Template code:
<qrcode data="{{vm.code}}"></qrcode>
@monospaced For some reason it doesn't work if installed using npm install angular-qrcode
app.js code:
import 'qrcode-generator';
import 'angular-qrcode';
angular.module('app', ['monospaced.qrcode'])
Template code:
<qrcode data="{{qrstring}}" size="160" version="15" error-correction-level="M"></qrcode>
any thoughts?
I'm also having the same problem with angular 1.6.x es6, any idea?
@shineum Thanks a lot !!
@ananth2020 @igorkurochka @brunocascio I've updated the README with info for ES6 imports:
https://github.com/monospaced/angular-qrcode#installation
@monospaced thanks!