title: How to iterate an array of objects and print key in AngularJS
body: <p>Following is the array of objects I am trying to iterate in ng-repeat and print keys, but unable to do so.</p>
  
  <pre><code>$scope.directivesInfo = [
      {"ngRepeat": {"enter": true, "leave": true, "move": true, "add": false, "remove": false}},
      {"ngView": {"enter": true, "leave": true, "move": false, "add": false, "remove": false}},
      {"ngInclude": {"enter": true, "leave": true, "move": false, "add": false, "remove": false}},
      {"ngSwitch": {"enter": true, "leave": true, "move": false, "add": false, "remove": false}},
      {"ngIf": {"enter": true, "leave": true, "move": false, "add": false, "remove": false}},
      {"ngClass": {"enter": false, "leave": false, "move": false, "add": true, "remove": true}},
      {"ngShow/ngHide": {"enter": false, "leave": false, "move": false, "add": true, "remove": true}},
      {"form/ngModel": {"enter": false, "leave": false, "move": false, "add": true, "remove": true}},
      {"ngMessages": {"enter": false, "leave": false, "move": false, "add": true, "remove": true}},
      {"ngMessage": {"enter": true, "leave": true, "move": false, "add": false, "remove": false}},
  ];
  </code></pre>
  
  <p>Following is in my View -</p>
  
  <pre><code>&lt;tr ng-repeat="(key, value) in directivesInfo"&gt;
  </code></pre>
  
  <p>But key is only printing 0,1,2,3 and so on but I want to print -</p>
  
  <p>ngRepeat, ngView, ... likewise.</p>
  
  <p>FYI - I am able to get the desired result from below mentioned array, but I am interested to achieve the same result from above array declaration.</p>
  
  <p>Working -</p>
  
  <pre><code>$scope.directivesInfo = [
      {"name":"ngRepeat", "enter": true, "leave": true, "move": true, "add": false, "remove": false},
      {"name":"ngView", "enter": true, "leave": true, "move": false, "add": false, "remove": false},
      {"name":"ngInclude", "enter": true, "leave": true, "move": false, "add": false, "remove": false},
      {"name":"ngSwitch", "enter": true, "leave": true, "move": false, "add": false, "remove": false},
      {"name":"ngIf", "enter": true, "leave": true, "move": false, "add": false, "remove": false},
      {"name":"ngClass", "enter": false, "leave": false, "move": false, "add": true, "remove": true},
      {"name":"ngShow/ngHide", "enter": false, "leave": false, "move": false, "add": true, "remove": true},
      {"name":"form/ngModel", "enter": false, "leave": false, "move": false, "add": true, "remove": true},
      {"name":"ngMessages", "enter": false, "leave": false, "move": false, "add": true, "remove": true},
      {"name":"ngMessage", "enter": true, "leave": true, "move": false, "add": false, "remove": false},
  ];
  </code></pre>
  
  <p>End Output -</p>
  
  <p><strong>EDIT -</strong></p>
  
  <p>Plnkr - <a href="http://plnkr.co/edit/vJ7pQmAYoIPpnVTi1vNi?p=preview" rel="nofollow noreferrer">http://plnkr.co/edit/vJ7pQmAYoIPpnVTi1vNi?p=preview</a></p>
  
  <p><a href="https://i.stack.imgur.com/CgzMv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CgzMv.png" alt="Iteration"></a></p>