如何使两列重复列表中的一项?

How to make two column to repeat for one item in the list?

angular repeat 是否有可能实现这一点?基本上我想知道有没有办法将这两个循环在一起?非常感谢任何帮助!

控制器:

$scope.date=[
    {ID:1,Date:'2016-11-12'},
    {ID:2,Date:'2016-11-15'},
    {ID:3,Date:'2016-12-06'}
]

HTML:

<table border="1" align="center">   
    <tr>            
        <th rowspan="2">ITEMCODE</th>
        <th rowspan="2">DEBTORCODE</th> 
        <th colspan="2" ng-repeat="d in date">{{d.Date}}</th>   
    </tr>       
    <tr>
        <th>Bal</th>
        <th>Order</th>
    </tr>
</table>

我希望 Bal 和 Order 列在每个日期列下并排重复。

您可以像这样使用嵌套 table 来完成此操作:

<table border="1" align="center">
<tr>
  <th rowspan="2">ITEMCODE</th>
  <th rowspan="2">DEBTORCODE</th>
  <th colspan="2" ng-repeat="d in date">
    <table border="1" >
      <tr>
        <th colspan="2">{{d.Date}}</th>
      </tr>
      <tr>
        <th>Bal</th>
        <th>Order</th>
      </tr>
    </table>
  </th>
</tr>
</table>

您可以使用 Angular 1.2

中引入的 ng-repeat-start 和 ng-repeat-end
<th ng-repeat-start="d in date">Bal</th>
<th ng-repeat-end>Order</th>

工作示例https://jsfiddle.net/9ve3fu0m/

您可以使用 ng-repeat-start 和 ng-repeat-end

<table border="1" align="center">   
<tr>            
    <th rowspan="2">ITEMCODE</th>
    <th rowspan="2">DEBTORCODE</th> 
    <th colspan="2" ng-repeat="d in date">{{d.Date}}</th>   
</tr>       
<tr>
    <th ng-repeat-start="d in date">Bal</th>
    <th ng-repeat-end>Order</th>
</tr>