Dhana Dhana - 2 months ago 5
JSON Question

How to get json keys using angularjs ng-repeat?

I have a json and I want to iterate and get the json keys:

Testing01
,
Testing02
and
Testing03
on my ng-repeat for my given json. How can I get it using ng-repeat ? Please let me know and thanks in advance.

Fiddle is available.

Answer
<div ng-controller="MyCtrl">
 <table>
   <tr ng-repeat="(key, data) in data.testingjson track by $index">
      <td> {{key}} </td> 
    </tr>
  </table>
</div>
Comments