ank5
asked on
Passing values between two HTML elements in angular [Ionic]
I am using ionic slide box, where I iterate over number of images and show them in the slide box
Just below the slidebox, I am showing an edit button. When user clicks on the button, then image that is loaded in the slidebox is opened is another page for editing.
How can I tell the anchor tag which index user is in when he clicks on the edit link.
<ion-slide-box>
<!-- Iterate n number of times, where n is the number of images -->
<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 is identified by a counter at the end. So, if there are 5 images then this code iterates 5 times and loads images called 'MyImage_1', 'MyImage_2' etc, and shows them in the slide box.Just below the slidebox, I am showing an edit button. When user clicks on the button, then image that is loaded in the slidebox is opened is 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 challenge is that how to find which image is opened in the slidebox. $index has this information but it is available only inside slidebox and not to a div outside of the slidebox.How can I tell the anchor tag which index user is in when he clicks on the edit link.
Does the active image not have a class to identify it is the active image
ASKER
Can you please elaborate what you mean by class?
It's just the below code that allows users to slide
It's just the below code that allows users to slide
<ion-slide-box>
<!-- Iterate n number of times, where n is the number of images -->
<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>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.