I was not able to load my images from the assets folder, I was using the Angular 18, after several atempts I was able to solve it.
Now on Angular 18 your assets folder needs to be on the path: public/
There is no needs to change angular.json See it here ...
In Angular 18, the default folder for all assets is now outside the src directory and is called public. Previously, you would reference assets with a path like this:
Before:
<img src="assets/logo.png" alt="" srcset="">
Now:
<img src="/logo.png" alt="" srcset="">
Additionally, if you check the angular.json file, you will see that public is now the default folder for assets:
"assets": [
{
"glob": "**/*",
"input": "public"
}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With