Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have a JSON data like

{
   tableList:["a","b"], 
   dbList:["c","d"], 
   score:[2 , 5] 
}

I want to print this using AngularJS in Table like

DB  Table  Score
c    a      2
d    b      5

Can we use mltiple ng-repeat with ng-repeat-start in this case? If yes How?

My controller is as follows

var app = angular.module('myApp');
app.controller('MyCtrl', function($scope,$http) {
    $http.get('http://localhost/service').success(function (thisdata) {
        //Convert data to array.
        var myData =  $.parseJSON(JSON.parse(thisdata.tableList));
        $scope.myData  =  myData;
    });

});

Is this correct or I need to modify this?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

No need for start...

<table>
   <tr>
     <td ng-repeat="(key,value) in json">{{key}}</td>
   </tr>
   <tr ng-repeat="(key,value) in json">
      <td ng-repeat="innerValue in value">{{innerValue}}</td>
   </tr>
</table>
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.