0

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.

3
  • have a look at this code ... Commented Sep 26, 2016 at 6:53
  • @dhana when you mark an answer you should give priority for the ones who answered fast, just for your information Commented Sep 26, 2016 at 7:16
  • @Sajeetharan, oh ok sure. Thanks You. Commented Sep 26, 2016 at 7:19

3 Answers 3

2
<div ng-controller="MyCtrl">
 <table>
   <tr ng-repeat="(key, data) in data.testingjson track by $index">
      <td> {{key}} </td> 
    </tr>
  </table>
</div>
Sign up to request clarification or add additional context in comments.

Comments

2

You could do it like this:

<div ng-controller="MyCtrl">
     <table>
       <tr ng-repeat="(key,value) in data.testingjson">
          <td> {{key}}: {{value}} </td> 
        </tr>
      </table>
</div>

Updated Fiddle: https://jsfiddle.net/0gucxcq2/6/

Comments

2

Just do this

<div ng-controller="MyCtrl">
 <table>
    <tr ng-repeat="(key,value) in data.testingjson">
          <td> {{key}}  </td> 
        </tr>
  </table>
</div>

FIDDLE

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.