I am working on a spring app with AngularJS. I have a response from a JS controller. I want to display in a table on the page.
devDebtTable is the object accessible to the page from the JS controller.
The response(mock data) from the JS controller I printed on the page, using {{devDebtTable}} is what I want to put into the table:
{"headers":["John","Larry","Steve"],"rows":[["Project1","14 Days","2 Days","1 Day"],["Project2","10 Days","4 Days",""],["Project3","","2 Days","10 Days"]]}
I want it in the format like:
Dev 1 Dev 2 Dev 3 Dev 4
Project 1 5 Days 2 Days 2 Days 1 Day
Project 2 5 Days 7 Days 2 Days
Project 3 3 Days 14 Days 12 Days
Project 4 12 Days 14 Days 5 Days
Project 5 33 Days 53 Days 23 Days
This is what I have tried so far, which isn't right.
<div class="container">
<table class="table table-bordered">
<thead>
<tr ng-repeat="data in devDebtTable">
<th scope="colgroup"></th>
<th scope="colgroup" ng-repeat="headers in data">{{headers}}</th>
</tr>
</thead>
<tr ng-repeat="row in devDebtTable.row">
<td>item:{{row}}</td>
<!--<td ng-repeat="item in row">item:{{item}}</td>-->
</tr>
</table>
</div>
I burned through 8 hours yesterday trying different things. What can I do to get that JSON response into a table on the page?