angular-qr icon indicating copy to clipboard operation
angular-qr copied to clipboard

Does not work in environment with require.js

Open OJezu opened this issue 10 years ago • 3 comments

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.

OJezu avatar Jan 30 '15 18:01 OJezu

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.

OJezu avatar Jan 30 '15 19:01 OJezu

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?

bailsman avatar Feb 11 '16 12:02 bailsman

+1 for webpack support

ghost avatar Feb 11 '16 20:02 ghost