I have created a Angular 4 based component library. I have also been able to successfully use this library in another Angular project. However, one of the components makes use of a SVG, which is located in the /assets folder of the library. This is being referred in the component as follows,
<img src="/assets/svg/icon_recommendation_close.svg"/>
Obviously, when this component is used the main app, the image is looked for in the /assets folder of the main app, which is not available resulting in HTTP 404.
Now my questions are,
- What are the options available to me to package images and other similar assets?
- How can these be made available to the main app?
- Is it possible to configure the main app to look into the
/nodes_modulefolder of the library if I am able to package the SVG into it? - The other option I was thinking was to inline the SVG into the HTML itself using a
gulputility. Is it ok to do this?
Thanks Sushil