AngularJS ng-repeat with unknown key value pairs
我需要使用Angular ng-repeat显示一个表,但我不知道它是不是预先的键。
例如,API的响应为
然后
在我的HTML中,我正在通过
进行ng-repeat
1 2 3 4 5 | <table id="customers"> <tr ng-repeat ="x in myCtrl.demoDetails"> </tr> </table> |
但是我将如何在表中打印值?
应该看起来像下面的样子,
1 2 3 4 5 6 7 8 9 10 11 12 | <table class="table"> <tr> <td>Task Name</td> <td>End Date</td> <td>Service Key</td> </tr> <tr ng-repeat="x in responseData.data.rows"> <td>{{x.task_name}}</td> <td>{{x.end_date}}</td> <td>{{x.service_key}}</td> </tr> </table> |