Angular 4 how to enter svg

I always used svg in tags or as a background image. Recently followed: https://css-tricks.com/using-svg/ I would like to enter my svg directly. Does Angular4 have any features that allow this?

+5
source share
1 answer

Updated answer:

As @ osama-felfel pointed out, the library doesn’t really implement it at the build stage, but embeds it when the component loads. I think this is even better since it allows you to load SVGs in parallel.

For a comment on the package size @ user776686, it is parsed and challenged here .


Original answer:

I think you have solved your problem, but I will post it here if anyone comes across this. I used this library . This allows you to enter svg at build time, so your css rules apply.

+1
source

Source: https://habr.com/ru/post/1270789/


All Articles