My project involves utilizing an ionic slide box to display a series of images within it.
<ion-slide-box>
<!-- I am looping through the images based on the image count -->
<ion-slide ng-repeat="n in [].constructor(imageCount) track by $index">
<img ng-src="MyImage-{{$index + 1}}.png" width="100%" height="auto" >
</ion-slide>
</ion-slide-box>
Each image has a unique identifier at the end, so if there are, for example, 5 images, the code iterates 5 times and displays images named 'MyImage_1', 'MyImage_2', and so on within the slide box.
Beneath the slidebox, there is an edit button displayed. When a user clicks on this button, the particular image being shown in the slidebox is opened on another page for editing.
<div style=" padding-bottom: 10px;">
<a class="button button-dark icon ion-edit" ui-sref="editImage({name:'MyImage_$index'})"></a>
</div>
The main challenge lies in identifying which image is currently open in the slidebox. The $index variable contains this information, but it is restricted only to the slidebox and not accessible outside of it.
I am seeking a solution on how to pass the index information from the slidebox to the anchor tag when a user clicks on the edit link.