I am very new to Angular js. And i can not understand why Angular can not properly work with <svg>
.
When i try to make SVG elements active with angular, i see errors in console:
For example in directive i have following template:
<svg xmlns='http://www.w3.org/2000/svg' class='svgtime'>\
<path stroke='#fff' stroke-width='5' d='M {{radius+line_size}} 2.50000119262981 A {{radius+line_size-2.5}} {{radius+line_size-2.5}} 0 1 1 {{radius+line_size-0.1}} 2.500055466403296 Z' fill='transparent'></path>
<path fill='transparent' stroke='#9BC7F2' stroke-width='2' ng-attr-d='M 60 2 A 58 58 0 0 1 77.83716831288882 5.497827994417321'></path>
I also set radius
variables in scope of directive, but this code does not works. Console indicates that i have invalide value for d
attribute of path element. I also tryed ng-attr-d
as suggested in official doc for Angular directives, but it does not worked too? Why this happens. What is so special in SVG elements. I think it is connected with how Angular replaces {{}} to actual values. May be {{value}} is replaced with Angular by calling $interpolate
after <svg>
is rendered and i get error?
Also i know about tricks like: How to prevent AngularJS from making lowercase HTML attributes But why ng-attr-*
does not works?