【发布时间】:2018-03-02 11:08:31
【问题描述】:
我在我的 ionic-angular 应用程序中使用 ngx-zxing 模块在我的应用程序中实现了一个 qr 扫描仪。
扫描后我想将用户重定向到扫描链接直接重定向的页面,无需用户手动干预。
code.html
<!-- code for qr scanner alreday implemented, the result is present in the below code -->
<div>
<a href="{{qrResult}}" #link></a>
</div>
code.ts
//all imports and components are written.I am directly implementing the function definition in in which I have to redirect to the link.
handleQrCodeResult(result: string) {
console.log("Result", result);
this.qrResult = result;
this.clickLink();
}
clickLink(){
let el = (<HTMLImageElement>document.getElementById('link'))
console.log('el', el); // this is returning null.
el.click();
}
【问题讨论】:
标签: javascript angular typescript ionic2