SVG 404 not found using Single Spa and Angular

327 Views Asked by At

When I refresh the page, I see in network that there is an error of 404 not found for the svg.

I'm trying to import an svg from an external file in assets/icons, like this.

<img src="../assets/icons/save.svg" />

The path is correct, but when I refresh the page, I see in network that there is an error of 404 not found for the svg. I also putted the path in angular.json but still not work.

I'm in Single Spa and using Angular. Thanks in advance!

1

There are 1 best solutions below

1
Roberto Valenza On BEST ANSWER

I just used another way to import image, using ID on container and import the svg from css:

#logo {
    background-image: url('../assets/icons/save.svg');
    width: 20px;
    height: 20px;
}
    <div id="logo"></div>