我在输入 SVG 路径 d = ""时遇到问题。我不明白这个错误信息。
html:
<svg style="height:300px">
<path d="{{ room.coordinate }}" ng-repeat="room in rooms" fill="blue" stroke="black" stroke-width="2"></path>
</svg>
SVG路径:M 150 0 L75 200 L225 200 Z
错误:
Error: Invalid value for <path> attribute d="{{ room.coordinate }}" jquery.min.js:3
Error: Invalid value for <path> attribute d="{{ room.coordinate }}" angular.min.js:23
最佳答案
这与这个问题有关:D3 Integration with Angular: "Error: Invalid value for <rect> attribute x"
而这个问题:https://github.com/angular/angular.js/pull/2061
每 <svg>
属性,ng-attr-<name>={{<evaluated value>}}
应该用来代替 <name>={{<evaluated value>}}
.
关于angularjs - <path> 的 svg 无效值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25923377/