javascript - Automatic Serial Nos in ng-Repeat (Angular) -
i using ng-repeat fill table data in controller (or services). however, need fullfill serial nos in first column automatically. getting static data 1 in columns. html: <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> </head> <body ng-app="myapp" ng-controller="myctrl"> <table> <tr><th>s.no.</th><th>name</th></tr> <tr ng-repeat="x in people"><td>1</td><td>{{x.name}}</td></tr> </table> <script> var app = angular.module('myapp',[]); app.controller('myctrl',function($scope){ $scope.people = [ {name:"peter"}, {name:"lina"}, {name:"roger"} ]; }); </script> </body> </html> output: i want numbers in first column 1, 2, 3, etc. how can achieve ngrepeat ? use $index : ...