i am just guessing  this , 

              <div ng-repeat="venue in venues" ng-mouseover="" 
class="venue">
                     <div ng-controller="manageInfo" >

the ng-controller is with in the repeat it is correct? 

try to change 
                     <div ng-controller="manageInfo" >
              <div ng-repeat="venue in venues" ng-mouseover="" 
class="venue">




On Monday, March 2, 2015 at 5:03:41 PM UTC+5:30, Yashwanth Maheshwaram 
wrote:
>
> I'm trying to implement a shortlisting functionality in a case where I'm 
> using ng-click inside ng-repeat.
>
> While the $index is being displayed correctly outside the ng-click, $index is 
> only the index of the last object in the JSON array in all the cases 
> where the html is generated using ng-repeat.
>
> I was expecting the respective venue or venue.id to be passed as an 
> argument to shortlistThis(). I'm guessing that this could be an issue 
> related to event binding.
>
> Can someone help me understand what's going wrong here and probably a 
> better way to do this if possible.
>
> I did try checking this Bind ng-model name and ng-click inside ng-repeat 
> in angularjs 
> <http://stackoverflow.com/questions/21385164/bind-ng-model-name-and-ng-click-inside-ng-repeat-in-angularjs>
>  The 
> fiddle here works just fine but, mine doesn't.
>
> Here's a fiddle that you can look into. Just zoom out a bit, click on any 
> name on the left pane and then, hit the shortlist button to see an alert. 
> The alert value is 7 in all the cases.
>
> http://jsfiddle.net/yashwanthm/mos9rvvs/
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to