Angular is not finding images in the assets if there are located in a sub folder

Viewed 22

I have a PNG image that I'd like to use as default if user didn't upload an image. For an hour now, I couldn't see the image.

<img src="assets/images/image-card.png" />

I tried to change the value of the asset in the angular.json, but it still didn't work

"assets": [
  "src/favicon.ico",
  "src/assets/images"
],

Only when I moved the image directly to the assets itself then it worked.

Is that how it's supposed to work? What if I have different types of files, can't I organize them in folders (images, videos, texts, etc.)

Thanks for helping

1 Answers

Try with

<img src="./assets/images/image-card.png" />
Related