<div ng-app="myapp" ng-controller="mycontroller as ctrl"> <table> <tr ng-repeat-start="(key,value) in ctrl.school"> <td>姓名:</td><td>{{ key }}</td> </tr> <tr ng-repeat-end><td>年齡:</td><td>{{ value.age }}</td></tr> </table> </div>
angular.module("myapp",[]). controller("mycontroller",[function() { var self = this; self.school = { "john": { "age": 18, "weight": 50 }, "jack": { "age": 19, "weight": 53 }, "mary": { "age": 20, "weight": 43 }, "bill": { "age": 22, "weight": 55 } } }]);