I've been with ionic for a short time and I do not know if what I'm trying to do can be done, the intention is that according to the user put a photo in a slider the slider go to the last photo put automatically, I have this code and I do not know if I'm on the right track
<ion-slides pager spaceBetween="10">
<ion-slide *ngIf="images.length === 0">
<img src="assets/imgs/not-available-es.png" />
</ion-slide>
<ion-slide *ngFor="let image of images; let i = index">
<button ion-button icon-only color="primary" class="remove-image" (click)="removePicture(i)">
<ion-icon name="trash"></ion-icon>
</button>
<img [src]="image" class="photo-image">
</ion-slide>
</ion-slides>
and the ts
readThis(inputValue: any): void {
if (inputValue.files[0]) {
let file: File = inputValue.files[0];
let myReader: FileReader = new FileReader();
myReader.onloadend = (e) => {
this.images.push(myReader.result);
console.log(this.slides.length());
}
myReader.readAsDataURL(file);
}
}