我在键入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与Angular的集成:"错误:<的值无效;rect>属性x";
这个问题:https://github.com/angular/angular.js/pull/2061
对于每个<svg>
属性,应使用ng-attr-<name>={{<evaluated value>}}
而不是<name>={{<evaluated value>}}
。