AngularJs从后端读取数据到前端

时间:2017-07-10 02:13:20

标签: angularjs

我正在努力将以下数据结构读入一个简单的网格。任何帮助将不胜感激。

[{“Value”:[],“name”:值,“name”:“value”,“name”:Value}]

1 个答案:

答案 0 :(得分:0)

$scope.backendAry = [{
    "Value":[],
    "name":Value,
    "name":"value",
    "name":Value
}];

//html
<table class="table">
<thead>
  <tr>
    <th>FirstValue</th>
    <th>SecondValue</th>
    <th>ThirdValue</th>
  </tr>
</thead>
<tbody>
  <tr ng-repeat="data in backendAry track by $index">
    <td>{{data.name}}</td> //put your key name instead name
    <td>{{data.name}}</td> //put your key name instead name
    <td>{{data.name}}</td> //put your key name instead name
  </tr> 
</tbody>