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

Issue

This Content is from Stack Overflow. Question asked by Richard77

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



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?