I have to show all images that are coming from a server as base64 strings. Thereofre I have created an array of images like this:
for (let i in json) {
this.imageArray.push({
imageUrl: json[i].datas
})
}
Now, I am trying to show these images from array in html file:
<ion-list no-lines>
<ion-item *ngFor="let item of imageArray">
<ion-img src="data:image/*;base64,{{item.imageUrl}}"></ion-img>
</ion-item>
</ion-list>
The images are not shown. but out of 10 time to it should be only 1 time.
please help me
Thanks
try this:
<ion-img [src]="'data:image/*;base64,'+item.imageUrl"></ion-img>
You have to wrote the following code
<ion-list [virtualScroll]="imageArray">
<ion-item *virtualItem="let item">
<ion-img src="data:image/*;base64,{{item.imageUrl}}" style="height: 300px; width: 100%;"></ion-img>
</ion-item>
</ion-list>
and in .ts file
for (let i in json) {
this.imageArray.push({
imageUrl: json[i].datas
})
}
hello all , am making one project in ionic in which task is taking picture through camera or choose image from list of images (in horizontal scroll bar list ) and send it to server …so here am facing one problem is how can i show on page that choose image from list…solution to choose image from list please
thanks in advance …you can see my below link for excepted output…I want such output any solution please ?