title: 2d multi level object in table with ng-repeat
body: <p>I have a 2D nested object like this</p>
  
  <pre><code>$scope.analysisDataNew = [
    {
      "data":{
        "row1":{
            "col1":{
                "subCol1": 10,
                "subCol2": 10,
            },
            "col2":{
                "subCol1": 10,
                "subCol2": 10,
                "subCol3": 10,
            },
            "col3":{
                "subCol1": 10,
            },
        },
        "row2":{
            "col1":{
                "subCol1": 10,
                "subCol2": 10,
            },
            "col2":{
                "subCol1": 10,
                "subCol2": 10,
                "subCol3": 10,
            },
            "col3":{
                "subCol1": 10,
            },
        },
      }
    }
  ];
  </code></pre>
  
  <p>I am trying to use it for creating a table for with ng-repeat.</p>
  
  <p>What i have tried so far is this</p>
  
  <pre><code>for (var i = 0; i &lt; $scope.analysisDataNew.length; i++) {
  
      // row list
      $scope.analysisDataNew[i].xAxis = Object.keys($scope.analysisDataNew[i].data);
  
      // col list 
      if($scope.analysisDataNew[i].subCol){
          var rows = Object.keys($scope.analysisDataNew[i].data);
          var cols = $scope.analysisDataNew[i].data[rows[0]];
          var colList = [];
          for(var j=0; j&lt;Object.keys(cols).length; j++){
              colList.push({name: Object.keys(cols)[j]});
              colList[j].subcol = [];
              for(var k=0; k &lt; Object.keys(cols[Object.keys(cols)[j]]).length; k++){
                  colList[j].subcol.push(Object.keys(cols[Object.keys(cols)[j]])[k]);
              };
          };
          $scope.analysisDataNew[i].colList = colList;
      } else {
          $scope.analysisDataNew[i].colList = Object.keys($scope.analysisDataNew[i].data[$scope.analysisDataNew[i].xAxis[0]]);
      };
      console.log($scope.analysisDataNew[i]);
  };
  </code></pre>
  
  <p>When there is no sub-column i am easily able to print the data but the problem is with sub-column.</p>
  
  <p>Can anybody please help??</p>