I'm trying to load images from the assets directory but they do not load in the view. This is what's happening;
- In assets directory I have a bunch of sub folders with images in the subfolders (icons and flags for instance)
assets_
|-img_
|-icons_
|-copyright.png
|-flags_
|-ch.png
|-us.png
- In the view I have the image paths as
<img src="assets/img/flags/jp.png" alt=""> and <img src="assets/img/icons/copyright.png" alt="">
- The Errors.
The image doesn't load in the view yet for a weird reason, the image in icons dir loads just fine.
When I inspect, this is what I discovered the following network call which is looking for the image from the root instead of assets.
Second, it says type is text/html instead of png and the initiator as VM639:330?!
However when I scroll further up, I discover the image had earlier been loaded just fine and the type and initiator are perfectly fine (png and index).
What exactly is going wrong here? Why can't I load images from the assets directory?




flags? Can you double-check that there's not reference to the flags other thanassets/img/, so not starting with a/? A comment on the "type": Because there is no file at/img/flags/jp.pngthe angular-cli dev server responds with the homepage by default. This is atext/htmlfile, so this is ok.