Angular: ng-repeat scope
http://angularjs.org/
by Sreekesh S K
HTML
<div ng-controller="MyCtrl">
<div ng-repeat="line in lines">
<div class="preview">{{line.text}} ===>Index = {{$index}}
<span id="xyz_{{$index}}">123456</span>
</div>
</div>
</div>
JavaScript
var myApp = angular.module('myApp', []);
function MyCtrl($scope) {
$scope.lines = [
{
text: 'res1'
},
{
text: 'res2'
},
{
text: 'res3'
},];
}