Angular: ng-repeat scope - 14410993
http://angularjs.org/
by manoj
HTML
<div ng-controller="MyCtrl">
<div ng-repeat="line in lines">
<div class="preview">{{line.text}} {{$index}}</div>
</div>
<div ng-repeat="line in lines">
<!-- typing here should auto update it's preview above -->
<input ng-model="line.text"/>
<!-- many other fields here that will also affect the preview -->
</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'}];
}