angular-qr
angular-qr copied to clipboard
Does not work in environment with require.js
On our page we use both angular and require.js. This package depends on qrcode.js setting its main function in global, but in presence of define
, qrcode.js exports itself as a module. Alas angular-qr tries to call undefined, which tends not to work.
Or I'm doing something wrong, which is always an option.
I have uploaded version which works with AMD to gpndata/angular-qr@4db22355398 . Unfortunately, I'm not angular guy, and I have no idea how karma works, so I did not make new tests yet (the existing ones are passing). If that helps, I can look into karma next week maybe, and then I can make a real pull request.
Would it be better to use https://github.com/umdjs/umd, specifically, https://github.com/umdjs/umd/blob/master/templates/returnExports.js so this also works in webpack?
+1 for webpack support