【问题标题】:Angular Variables inside SVGSVG 中的角度变量
【发布时间】:2015-03-25 01:06:45
【问题描述】:
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}}"

我对 svg 中的属性使用角度范围变量,一切正常,但在控制台中出现此错误。如何摆脱它们?谢谢。

【问题讨论】:

    标签: angularjs svg


    【解决方案1】:

    我觉得你应该试试ng-attr-x="{{xForLabels.text}}"

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

    【讨论】:

    猜你喜欢
    • 2011-01-28
    • 2021-11-26
    • 2021-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-13
    • 2021-10-24
    相关资源
    最近更新 更多