【发布时间】:2012-06-12 20:01:06
【问题描述】:
除了呈现对象中的属性值之外,我还想将属性名称呈现为标签。有没有办法用ng-repeat 做到这一点?例如:
<ul>
<li ng-repeat="option in data">{{propertyName}}: {{option}}</li>
</ul>
这可能会吐出这样的东西:
<ul>
<li>Name: John</li>
<li>Phone: (123) 456-7890</li>
<li>Country: England</li>
</ul>
【问题讨论】:
标签: angularjs angularjs-ng-repeat