Angular: ng-repeat scope - 14410993
http://angularjs.org/
by sqiudward
HTML
<div ng-controller="MyCtrl">
<div ng-repeat="line in lines">
<div class="preview">{{lines[$index - 1].text}} {{$index}}</div>
</div>
</div>
JavaScript
var myApp = angular.module('myApp', []);
//myApp.directive('myDirective', function() {});
//myApp.factory('myService', function() {});
function MyCtrl($scope) {
$scope.lines = [{
text: 'A'},
{
text: 'B'}];
}