Angular: ng-repeat scope - 14410993

http://angularjs.org/

HTML

<div ng-controller="MyCtrl">
  <div ng-repeat="line in lines.slice(0,6)">
      <div class="preview">{{line.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: 'res1'},{ text: 'res2'},{ text: 'res2'},{ text: 'res3'},{ text: 'res4'}];
}