Topic: Images not loading from assets folder in Angular
mani12 free asked 4 years ago
assets and images folder location: projectfolder\src\assets\images
You're using the wrong path to the images.
In the Angular project, you don't have to add the relative path from your file to image file.
Angular resolves this problem for you, and in a component, you have to only add a path to the assets folder, instead of ../../assets.
This code will work:
<img src="assets/img.jpg" alt="">
and this code will not work:
<img src="../../assets/img.jpg" alt="">
Do you have img.jpg file in the src/assets folder? It's necessary to put there an image file.
Please take a look at this StackOverflow question.
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Free
- Premium support: No
- Technology: MDB Angular
- MDB Version: MDB5 2.3.0
- Device: PC
- Browser: chrome
- OS: windows
- Provided sample code: No
- Provided link: No