Angularjs:如何在模板上的两行中交替地在两个div(按行)中填充两个不同的列表



我有两个不同的列表(每个列表来自不同的API(。如何在AngularJS中的模板上的两行中交替填充两个div中的数据?

如果我不清楚,请告诉我。我对此还比较陌生。

<div class="container">
<div class="row">
<div class="col">
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">api_1</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="n in api_1">
<th>{{n.id}}</th>
<td>{{n.name}}</td>
</tr>
</tbody>
</table>
</div>
<div class="col">
<table class="table">
<thead>
<tr>
<th scope="col">#</th>
<th scope="col">api_2</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="n in api_2">
<th>{{n.id}}</th>
<td>{{n.name}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>

plunker:http://plnkr.co/edit/tLehZCkpuo0DL5eLNk8z?p=preview

最新更新