angular-qr icon indicating copy to clipboard operation
angular-qr copied to clipboard

scope variable isnot recognized as valid text

Open thunder312 opened this issue 8 years ago • 3 comments

Directive: scope.qrData = 'http://' + scope.assignedIp + ':8002/#/instrumentState';

"scope.assignedIP" is the current assigned IP of the PC.

HTML: <qr size="100" text="qrData"></qr>

Error: Error: The text attribute is required. at Object.postlink [as link]

Findings so far: I have tried several other scope variables on this page and none of these is working. A simple String is working. (<qr size="50" text="'simpleString'"></qr>). So I guess, I installed the package correctly.

thunder312 avatar Mar 24 '17 09:03 thunder312

@thunder312 I experience the same issue, have you found by any chance what is causing this nasty issue ? Is it possible it is from angular version ? I am using angular 1.5.x Thanks

nsdonev avatar Jun 16 '17 18:06 nsdonev

Set ng-init=" qrData = ' ' " before <qr size="100" text="qrData"></qr>

this will set ngmodel and will not throw the error.

gurdeep2711 avatar Nov 03 '17 08:11 gurdeep2711

@gurdeep2711 I use it, Set ng-init=" qrData = ' ' " before

and it works, thank you

BoWang816 avatar Apr 08 '19 06:04 BoWang816