Is possible to reach variable outside the ng-repeat scope?
jsfiddle: http://jsfiddle.net/zcbhubrw/
Here is the code:
HTML
you can call a function while clicking the list inside ng-repeat
like this
<a href="#" ng-click="setCount($index)">
and defining the function in controller
$scope.setCount = function(index) {
$scope.count = index;
} ;
and updating the count value when you click
Here is a working plunker with your code,
http://embed.plnkr.co/rAbanmAR2Chw3P501tDc/preview
Hope this helps!
You can create function in the controller to set the count or refer the parent scope from inside the ng-repeat
ng-click="$parent.count = $index"
using parent scope
using function