How to use ng-repeat to iterate over map elements in AngularJS

How would you go through the entries on the map so that you can print both the input key and the value? For example, I would like to do something like this:

<ul> <li ng-repeat='mapEntry in {"First Name":"John", "Last Name":"Smith"}'> <span>Key: {{mapEntry.key}}, value: {{mapEntry.value}}</span> </li> </ul> 
+55
angularjs
Feb 05 '13 at 9:33
source share
1 answer

From docs, I found this syntax:

 <ul> <li ng-repeat='(key, value) in {"First Name":"John", "Last Name":"Smith"}'> <span>Key: {{key}}, value: {{value}}</span> </li> </ul> 
+126
Feb 05 '13 at 9:33
source share



All Articles