特有属性:
$index,$first,$last
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>AngularJS</title> <link rel="stylesheet" href="css/foundation.min.css"> <style type="text/css"> .tx { width: 50px; height: 50px; margin-bottom: 10px; magin-left: 80px; } </style> </head> <body ng-app="app" ng-controller="AddressCtrl"> <div style="padding:10px; font-weight:bold" >地址管理</div> <ul class="ui-list ui-list-link ui-list-text ui-list-active ui-border-tb"> <li ng-repeat="item in list" class="ui-border-t"> <h4>{{$index+1+'.'+item.address + $first +' '+ $last}}</h4> </li> </ul> </body> <script src="js/angular.min.js"></script> <script src="app.js"></script> </html>
angular.module('app',[]) .controller('AddressCtrl',function ($scope) { $scope.list = [ {id:1,address:'1村'}, {id:2,address:'2村'}, {id:3,address:'3村'}, {id:4,address:'4村'} ]; })