title: AngularJS: How to get the key of a JSON Object
body: <p>I am unsure if this has got anything to do with AngularJS at all and if it is only JSON related.  </p>
  
  <p>Anyhow, let us say that we have the following JSON:</p>
  
  <pre><code>$scope.dataSets = {
      "names": ["Horace", "Slughorn", "Severus", "Snape"],
      "genders": ["Male", "Female"]
  }
  </code></pre>
  
  <p>Now, I am using the ng-repeat directive to print the above as follows:</p>
  
  <pre><code>&lt;div ng-repeat="data in dataSets&gt;
      //Continue readig to know what I am expcting here
  &lt;/div&gt;
  </code></pre>
  
  <p>What I expect within the <code>&lt;div&gt;&lt;/div&gt;</code> tags is to print "name" and "genders". That is, I wish to print the keys of the JSON. I have no idea what the keys are, as in they could be anything. How can I do this?</p>