Within my code, I have an array defined as follows:
public items = ['item1', 'item2', 'item3'];
This array is utilized in the view using the following structure:
<ion-slide> <ion-list inset>
<ion-item *ngFor="let item of items" (click)="getItem(title)">
{{ title }}
</ion-item>
</ion-list> </ion-slide>
The function getItem(title)
is written like this:
getItem(item) {
console.log(item);
this.slider.slideNext();
}
This function allows me to navigate to the next slide and pass the selected item as a parameter. On the second slide, the HTML structure looks like this:
<ion-slide> <ion-item>
<ion-label stacked>Label</ion-label>
<ion-input type="text">{{ item }}</ion-input>
</ion-item> </ion-slide>
The goal here is to display the chosen item from the first slide within the input field on the second slide.