Hi everyone! I’m developing a social network (something like Instagram).
I have a doubt about how to display photos in posts:
Method 1, result.immagine is a base64 image:
<ion-card *ngFor="let result of results">
<ion-card-header>
...
</ion-card-header>
<ion-card-content>
<img src="data:image/JPEG;base64,{{result.immagine}}"/>
</ion-card-content>
</ion-card>
Method 2, result.immagine is a link (http://www.xxxxx.it/image.jpg):
<ion-card *ngFor="let result of results">
<ion-card-header>
...
</ion-card-header>
<ion-card-content>
<img src="{{result.immagine}}"/>
</ion-card-content>
</ion-card>
Which method is better, and why?
Why method 1 doesn’t show any image, returning error for unsafe image, and how can I resolve this issue?
Thank you.