Also I believe that the array of images needs to be array (better to use JSON)of links to the images only then will the image show up on the browser when ngFor is used to display each image
<div *ngIf="images">
<ul>
<li *ngFor="let image of images">
<img [src]="image.href" />
</li>
</ul>
Also I think Maybe a better would be to use ngOnInit so that all initialization is done when that div is called
<div ngOnInit>
<ul>
<li *ngFor="let image of images">
<img [src]="image.href" />
</li>
</ul>
And in the component you can run your code as you wish
images = [];
ngOnInit() { type your code here it is similar to a constructor, here you can call your service or factory to get array of images you can initialize images here }
Where the image array is something like this
{
"images" : [
{
"name" : "image1",
"href" : "http://east-nj1.photos.example.org/987/nj1-1234"
},
{
"name" : "image2",
"href" : "http://east-nj1.photos.example.org/987/nj1-1234"
},
{
"name" : "image3",
"href" : "http://east-nj1.photos.example.org/987/nj1-1234"
},
{
"name" : "image4",
"href" : "http://east-nj1.photos.example.org/987/nj1-1234"
}
]
}
Copy Paste this blockquote in this link you will get an idea how the data is passed link you can access each property of the JSON value as image.name and image.href. Hope you find this usefull