#img not showing in the browser

3 messages · Page 1 of 1 (latest)

still zinc
#

i am having a problem i think it is related to the html tag in my angular app the it is not showing the image in the browser any fix to the problem
the image is saved in array like this

export class HomeComponent {
housingLocationList : HousingLocation[] = [
{
"id" : 0 ,
"name":"Acme Fresh Start Housing",
"city" :"chicago",
"state":"IL",
"availableUnits": 4,
"wifi": true ,
"laundry": true,
"photo":"./house02.jpg",
},
than its called here :

<section class = "listing">
<img class="listing-photo" [src]="HousingLocation.photo"
alt="Extirior photo of {{HousingLocation.name}}">

here is the repo : https://github.com/safoan/my-app-ng

GitHub

angular cli app. Contribute to safoan/my-app-ng development by creating an account on GitHub.

median magnet
# still zinc i am having a problem i think it is related to the html tag in my angular app th...

Your images live in the home directory, but you're trying to display them in a component that lives in the housing-location directory. So, the path to the image is incorrect.
I would move the images to the assets folder and reference them like this in the housingLocationList: "photo": "assets/house01.jpg". The housing-location component should now be able to find the image in the assets folder.

still zinc
#

thank u sir it worked fantastic