Possible Duplicate:
AngularJS - How can I reference the property name within an ng-Repeat
I have a JSON file like that:
fields: {
alias: {
type: "string",
},
name: {
type: "string",
}
}
I want something like that:
<dl ng-repeat="for field in fields.items">
<dt>
{{ field.key }}
</dt>
<dd>
{{ field.value }}
</dd>
</dl>
thanks in advance!
according to ngRepeat docs you can use "(key, value) in expression" as parameters – where key and value can be any user defined identifiers, and expression is the scope expression giving the collection to enumerate.
For example: (name, age) in {'adam':10, 'amalie':12}.