###前提・実現したいこと
Angular2でQR decodeをこちらを参考に実装したい
###エラーが出るのコード
エラー内容(consoleのログ)
ReferenceError: qrcode is not defined
app.component.ts
result: string; qrcode = new qrcode(); constructor() { qrcode.callback = function(res) { <ーーーーーーーーーここでエラー if (res == 'error decoding QR Code') { this.result.text('QRコードの解析に失敗'); } else if (this.isURL(res)) { this.result.html('<a target="_blank" href="' + res + '">' + res + '</a>'); } else { this.result.text(res); } }; }
###試したこと
こちらを参考にTypeScript型定義ファイルを作成しましたがダメでした。
###備考
参考HPにあるJSはsrc/assets/jsフォルダ内において、
angular-cli.jsonのscripts部分で読み込んでいます。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。