I’m try to push multiple image in a array and show in html page but there are showing nothing
.TS
takePhoto(sourceType) {
console.log("coming here");
const options: CameraOptions = {
quality: 50,
destinationType: this.camera.DestinationType.DATA_URL,
encodingType: this.camera.EncodingType.JPEG,
mediaType: this.camera.MediaType.PICTURE,
targetWidth: 450,
targetHeight: 450,
saveToPhotoAlbum: false,
sourceType: sourceType,
};
this.camera.getPicture(options).then(
imageData => {
this.base64Image = "data:image/jpeg;base64," + imageData;
this.photos.push({
"postaddimage":this.base64Image,
"userid":this.user_id,
});
this.photos.reverse();
},
err => {
console.log(err);
}
);
}
.html
<ion-grid>
<ion-row>
<ion-col col-4 *ngFor="let photo of photos; let id = index">
<ion-card>
<!--<p class="text-right"><ion-icon name="trash" class="deleteIcon" (click)="deletePhoto(id)"></ion-icon></p>-->
<ion-icon name="trash" class="deleteIcon" color="primary" (click)="deletePhoto(id)"></ion-icon>
<p><img [src]="photo.postaddimage" *ngIf="photo.postaddimage"/></p>
</ion-card>`
</ion-col>
</ion-row>
</ion-grid>
where am doing wrong
Please help me out.