好的,我有这个代码:
<table class="table">
<thead>
<tr>
<th>
Description
</th>
<th>
Amount
</th>
<th>
Period
</th>
</tr>
</thead>
<tbody data-ng-repeat="expense in expenses">
<tr class="danger">
<td>
<button data-ng-if="expense.Children.length > 0 && expense.ShowChildren" type="button" class="btn btn-default btn-sm" ng-click="expense.ShowChildren = false">
<span class="glyphicon glyphicon-minus" aria-hidden="true" ></span>
</button>
<button data-ng-if="expense.Children.length > 0 && !expense.ShowChildren" type="button" class="btn btn-default btn-sm" ng-click="expense.ShowChildren = true">
<span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
</button>
{{ expense.Description }}
</td>
<td>
{{ expense.Amount }}
</td>
<td>
{{ expense.Period }}
</td>
</tr>
<tr class="active" ng-show="expense.ShowChildren" data-ng-repeat="child in expense.Children">
<td>
    {{ child.Description }}
</td>
<td>
    {{ child.Amount }}
</td>
<td>
    {{ child.Period }}
</td>
</tr>
</tbody>
</table>

现在我想花钱可以有一个像你在照片中看到的孩子,这是工作,但是当孩子有了孩子,我怎么展示呢?我想做加号/减号按钮
发布于 2015-09-18 00:08:42
我最近一直在用泳道的桌子,效果很好。这是他们支持的一个特性。此表可在此处查看。
http://swimlane.github.io/angular-data-table/
您可以这样做,但基本上必须使用在适当位置插入按钮的表达式和ng-show/css在按钮被单击时隐藏和显示行,以及许多其他手动工作。
发布于 2015-09-18 06:00:46
我找到了一种简单的方法
Tree View: http://jsfiddle.net/brendanowen/uXbn6/8/它比其他方法更好,也更简单
https://stackoverflow.com/questions/32635009
复制相似问题