andrey
andrey

Reputation: 1977

Angular Variables inside SVG

Error: Invalid value for <text> attribute x="{{xForLabels.text}}"
angular.js:2390 Error: Invalid value for <text> attribute x="{{xForLabels.textNumber}}"
angular.js:2390 Error: Invalid value for <circle> attribute cx="{{xForLabels.circle}}"
angular.js:2390 Error: Invalid value for <text> attribute x="{{xForLabels.text}}"
angular.js:2390 Error: Invalid value for <text> attribute x="{{xForLabels.textNumber}}"

I use angular scope variables for attributes inside svg, everything works as i expect, but in console i get this errors. how to get rid of them? thank you.

Upvotes: 4

Views: 3204

Answers (1)

maxisam
maxisam

Reputation: 22745

I think you should try ng-attr-x="{{xForLabels.text}}"

ref: https://docs.angularjs.org/guide/interpolation#-ngattr-for-binding-to-arbitrary-attributes

Upvotes: 9

Related Questions