Angular5 Instascan - addListener不工作
innerHTML >>,它不工作了。但是警觉和function>>之外,它的工作
scanner.addListener('scan', function (content) {
//console.log(content); //It's work
//alert(content); //It's work
this.text2.innerHTML=content; //It's not working.
this.setText(content); //send to other functions >>It's not working.
});发布于 2018-05-05 02:19:08
试试这个:
scanner.addListener('scan', function (content) {
//console.log(content); //It's work
//alert(content); //It's work
this.text2 = content; // <--- Change to this
this.setText(content); //send to other functions >>It's not working.
});在你的元素上:
<some-element>{{text2}}</some-element>https://stackoverflow.com/questions/48752771
复制相似问题