Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

razor text element in svg

$
0
0

I am having trouble putting binding svg text elements in razor. If I do this

<svg><text x="1">hello world</text></svg>

it works fine - but if I do this:

<svg>    @for (var i=0;i<10;i++)    {<text x="1">hello world</text>    }</svg>

it gives me an error saying text elements can't contain attributes - ie clearly it's forgotten that it's inside svg.

I can sort of hack around it by going

<svg>    @for (var i=0;i<10;i++)    {<text><text x="1">hello world</text></text>    }</svg>

which works but is ugly as - anyone know what the problem is and how to fix it?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>