title: How to use ng-grid of Angular JS for varying JSON data?
body: <p>I have a JSON data. Simplified example: </p>
  
  <pre><code> [{"name":"xxx","age":23},{"name":"yyy","age":25}]
  </code></pre>
  
  <p><strong>Data can vary (even keys can be different).</strong></p>
  
  <p>I want to show this as a table on UI using AngularJs. I am a new to Angular world. I am using ng-grid for this. </p>
  
  <p>In my JS file :</p>
  
  <pre><code>        //queryResponse is having above mentioned JSON data.
  
              $scope.gridOptions = {
              data: 'queryResponse',
              rowHeight:46,
              headerRowHeight:40,
              enablePaging: false,
              showFooter: false,
              enableRowSelection: false,
              columnDefs: [....]       
              };
  </code></pre>
  
  <p>What should be there in <code>columnDefs</code> as I can't hard code<code>displayName</code>, it should be taken from keys of JSON data like <code>name</code> &amp; <code>age</code> for above mentioned code? </p>