stroke attribute of a circle html element cannot be set dynamically

15 views
Skip to first unread message

mattal...@gmail.com

unread,
Nov 30, 2015, 5:20:04 AM11/30/15
to Polymer
Hello,

i'm trying to set a stroke dynamically on a circle element like this :

<circle class="circle_animation" r="45" cy="50" cx="50" stroke-width="4" stroke="{{data.color}}" fill="none"/>
but it doesn't work...the circle stays white.

data.color is well set as 
<div>{{data.color}}</div>
prints the color.

When I do
<circle class="circle_animation" r="45" cy="50" cx="50" stroke-width="4" stroke="#000000" fill="none"/>
it works.

Any ideas ?

Thank you.

Ashley

unread,
Nov 30, 2015, 8:29:01 AM11/30/15
to Polymer, mattal...@gmail.com
Hello,

you need to change stroke="{{data.color}}" to stroke$="{{data.color}}" and it should work 100%.


Hope this helps.
Reply all
Reply to author
Forward
0 new messages