angular - After Installing @zxing/library in ionic3, There is an error. How Can I solve?
问题描述
I'd like to solve the error about using BrowserQRCodeReader
from @zxing/library
I'm using TypeScript version 3.4.5 and ionic3.
I installed the plugin typing $npm i @zxing/library --save
and applied it to the code I am writing and I get an error.
I want to know the cause of the error and how to solve it.
Here's the code I wrote.
import { Component } from '@angular/core';
import { BrowserQRCodeReader } from '@zxing/library';
...
...
...
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
...
...
...
target_wallet_address: string;
...
...
...
decode(){
const codeReader = new BrowserQRCodeReader()
codeReader.decodeFromImage(undefined,this.imagePath)
.then((result) => {
console.log("success")
this.target_wallet_address = result.getText();
}).catch((err) => {
console.error(err)
})
}//end decode
...
...
...
Here's the message and there's no display.
Initializers are not allowed in ambient contexts.
I wanted to get a specific layout, but I could not.
p.s. I added a screenshot file about the error message.
解决方案
推荐阅读
- linux - 如何在 shell 脚本中获取二进制执行结果?
- javascript - 使用正则表达式查找 ![image](url)
- reactjs - 如何在类组件中使用调度或如何重构我的 HOC
- c# - 如何处理 Selenium 中的“需要身份验证”窗口?
- node.js - Express 提供一些静态文件,但不提供其他文件
- python - TFLIte 无法设置张量:模型转换时尺寸不匹配
- python - 在灰度图像上使用 PIL putpixel 时,不了解有关新样式 getargs 的 SystemError
- javascript - UncaughtTypeError products.map 不是函数
- javascript - Javascript - 从 1,675 到 1,67 - 默认情况下,它会四舍五入到 1,68
- python - 在python中使用networkx计算无向图中大小为k的团的最佳方法是什么?