I have always used svg in tags or as background-image. Having recently followed : https://css-tricks.com/using-svg/ I would like to inject my svg directly. Has Angular4 any features allowing so ?
Updated answer:
As @osama-felfel pointed out, the library indeed doesn't inject during build phase, but instead inject it as the component is loaded. I think this is even better, as it allow for the SVG to be downloaded in parallel.
For the bundle size comment by @user776686, it is analyzed and contested here.
Original answer:
I guess you solved your problem, but I will post this here if anybody stumbles upon this. I used this library. It allows the svg to be injected during the build phase, so your css rules are applied.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With