In my controller, I have data like:
$scope.object = data
Now this data is the dictionary with keys and values from json
.
I can access the attribute with object.name
in the template. Is there any way that I can iterate over the keys as well and display them in table like
<tr><td> {{key}} </td> <td> data.key </td>
The data is like this
{
"id": 2,
"project": "wewe2012",
"date": "2013-02-26",
"description": "ewew",
"eet_no": "ewew",
}
If you would like to edit the property value with two way binding:
Complete example here:-
Here's a working example:
edited
I don't think there's a builtin function in angular for doing this, but you can do this by creating a separate scope property containing all the header names, and you can fill this property automatically like this:
A todo list example which loops over object by
ng-repeat
:https://docs.angularjs.org/api/ng/directive/ngRepeat