Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

svg invalid value for <path>

Tags:

angularjs

svg

I have a problem with typing the SVG path d = "". I do not understand this message of error.

html:

<svg style="height:300px">
   <path d="{{ room.coordinate }}" ng-repeat="room in rooms" fill="blue" stroke="black" stroke-width="2"></path>
</svg>

SVG path: M 150 0 L75 200 L225 200 Z

Error:

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
like image 934
user3780659 Avatar asked Sep 29 '22 20:09

user3780659


1 Answers

This relates to this question: D3 Integration with Angular: "Error: Invalid value for <rect> attribute x"

And this issue: https://github.com/angular/angular.js/pull/2061

For every <svg> attribute, ng-attr-<name>={{<evaluated value>}} should be used instead of <name>={{<evaluated value>}}.

like image 182
Augustin Riedinger Avatar answered Oct 03 '22 03:10

Augustin Riedinger