0

I am building an angular 9 application that gets while running, svg file path parameters and I need to dynamically display it on screen.

I need to update the color of the SVG, according to the user's choice dynamically as well. I tried to use the object element:

<object data = "assets/svg/female.svg" type = "image / svg + xml"> </object>

It shows me the svg file, but the style I put doesn't affect at all How can write style to the SVG that come from object element? or Is there another good way to add svg file dynamically? Thanks

Shabbir Dhangot
  • 8,954
  • 10
  • 58
  • 80
  • 1
    Does this answer your question? [How to change the color of an svg element?](https://stackoverflow.com/questions/22252472/how-to-change-the-color-of-an-svg-element) – Shabbir Dhangot May 17 '20 at 12:53
  • no, It doesn't answer me. My question is in Angular 9, how to update color when using svg dynamically from svg file. – Yosef Buskila May 17 '20 at 16:18
  • There is no fundamental difference in it, you are still using same styles. It also doesn't matter if the file is loaded dynamically. – Láďa Durchánek May 17 '20 at 21:30

0 Answers0