quaggajs

QuaggaJS with Angular 2 problems

匆匆过客 提交于 2019-12-02 03:16:03
问题 I'm trying to use QuaggaJS with Angular 2. I have the quagga.d.ts file in the app folder and the following import statements in the component: import Quagga from './quagga.d'; The guide says from 'quagga' but it doesn't work but above works declare const Quagga = require('quagga').default; I have the following code in the constructor of the component like this: constructor() { Quagga.init({ inputStream : { name : "Live", type : "LiveStream", target: document.querySelector('#yourElement') //

QuaggaJS with Angular 2 problems

六眼飞鱼酱① 提交于 2019-12-01 22:57:46
I'm trying to use QuaggaJS with Angular 2. I have the quagga.d.ts file in the app folder and the following import statements in the component: import Quagga from './quagga.d'; The guide says from 'quagga' but it doesn't work but above works declare const Quagga = require('quagga').default; I have the following code in the constructor of the component like this: constructor() { Quagga.init({ inputStream : { name : "Live", type : "LiveStream", target: document.querySelector('#yourElement') // Or '#yourElement' (optional) }, decoder : { readers : ["code_128_reader"] } }, function(err) { if (err)