Image is not found in Angular application

Discussão em 'Angular' iniciado por Frank Mehlhop, Maio 26, 2025.

  1. I got a image in my angular app.

    [​IMG]

    I'll try to embed it as an image:

    <img src="assets/images/flag.png" alt="Flag of Germany" />


    At the browser it is not shown and I get the error: http://localhost:4200/assets/images/flag.png 404 (Not Found)

    When I put the path at the browser it is also not available.


    http://localhost:4200/src/assets/images/flag.png http://localhost:4200/assets/images/flag.png
    ​

    The images is working, I can open it through the explorer.

    I adjust my angular.json like this: (for test and build)

    "assets": [
    {
    "glob": "**/*",
    "input": "public"
    },
    {
    "glob": "**/*",
    "input": "src/assets"
    },
    {
    "glob": "**/*",
    "input": "src/assets/images"
    }
    ],


    I did restart the app and no differences happend.

    I also checked this thread, but I can't find a solution: Angular, image not found (GET 404)

    Do you got a idea why the image is not available or what I could try?

    Continue reading...

Compartilhe esta Página