In order to bind to SVG element attributes in Angular, you must prefix them with attr
:
For your circle this will be:
<svg height="100" width="100">
<circle fill="white"
[attr.cx]="parsedSize/2"
[attr.cy]="parsedSize/2"
[attr.r]="radius"
[attr.stroke]="stroke"
[attr.stroke-width]="strokeWidthCapped"
[attr.stroke-dasharray]="circumference"
[attr.stroke-dashoffset]="(1 - parsedComplete) * circumference"/>
</svg>
I am not entirely sure if it should be [attr.stroke-width]
or [attr.strokeWidth]
, but give it a shot.
You need to use the attr
prefix when the attribute has no property associated