<div ng-app="myapp" ng-controller="mycontroller as ctrl"> <div ng-repeat="(key,value) in ctrl.school" ng-class="{first : $first}"> {{ $index + 1 }}. <br /> 姓名:{{ key }} <br /> 年齡:{{ value.age }} 歲<br /> 體重:{{ value.weight }} cm <br /><br /> </div> </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 } } }]);
.first { font-weight:bold; font-style: italic; }