html表中的AngularJS递归

html表中的AngularJS递归,angularjs,html,Angularjs,Html,好的,我有这个代码: <table class="table"> <thead> <tr> <th> Description </th> <th> Amount

好的,我有这个代码:

        <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>
                    &emsp;&ensp;&emsp;&ensp;{{ child.Description }}
                </td>
                <td>
                    &emsp;&ensp;&emsp;&ensp;{{ child.Amount }}
                </td>
                <td>
                    &emsp;&ensp;&emsp;&ensp;{{ child.Period }}
                </td>
            </tr>
            </tbody>
        </table>
现在我想要一个像你在照片中看到的那样的孩子 这是工作,但当孩子有了孩子,我怎么显示呢?
我想做加号/减号按钮

我最近一直在使用swimlane的一张桌子,效果很好。这是他们支持的功能。这张桌子在这里


您可以这样做,但基本上必须使用表达式在适当的位置插入按钮,并在单击按钮时使用ng show/css隐藏和显示行,以及许多其他手动工作

我找到了一个简单的方法

Tree View: http://jsfiddle.net/brendanowen/uXbn6/8/

它比其他方法更好,更简单

可以使用ng重复开始和ng重复结束。在使用ng repeat end创建的行中放置子项详细信息,但当我想显示其中一个子项的子项时,如何写入子项例如,如果书籍有子项,如何执行?在ng repeat end中使用嵌套的ng repeat rowu可以为我编写一个示例?我找到了树表选项ty:D