在 HTML table 标签中使用 AngularJS ng-repeat-start 和 ng-repeat-end 的同一实体的嵌套循环

Nested loop of same entity using AngularJS ng-repeat-start and ng-repeat-end in HTML table tag

假设我有一个名为 GrandPa 的实体被传递到我的 razor 视图,它的模型如下所示 (ParentChiled)。如您所见,Child 属性 是 ParentChiled class 列表,使用 GrandPa 实体有 2 个内部 Child ParentChiled 类型列表,我想遍历每个 [=46] =] 也在那里打印名称。

Class ParentChiled
{
    public string Name {get;set;}
    public List<ParentChiled> Child {get;set;} //list of current class
}

这里是我试过的 由于我想使用 ng-repeat-start 一直循环到最里面的 Child 属性 并结束,因此下面是我如何尝试循环遍历它们并打印它们。第一行和第二行是爸爸和儿子正在打印 但是第三行的孙子没有打印

 <table>
  <tr ng-repeat-start="dad in GrandPa">
    <td>{{dad.Name}}
  </tr>
  <tr ng-repeat="Son in dad.Child">
    <td>{{Son.Name}}
  </tr>
  <tr ng-repeat-end="grandSon in Son.Child">
    <td>{{grandSon.Name}}
  </tr>
</table>

我也尝试了以下来自 Whosebug 的链接,但它们与我的问题不同,我试图将它们用于我的问题,但没有用

[Link1][1]
[Link2][2]
[Link3][3]
[Link4][4]

注意: 我尝试使用 angularjs 的 Batarang chrome 扩展进行调试,实际上 {{grandSon.Name}} 有数据,所以问题很可能是 ng-repeat

我是 Whosebug 的新手,如果我的问题没有按照您预期的方式格式化,我提前道歉,我希望您的主人纠正我。

感谢您的帮助和支持

这是答案,我得到它工作得很好

<table>
  <tr ng-repeat-start="dad in GrandPa">
    <td>{{dad.Name}}
  </tr>
  <tr ng-repeat-start="Son in dad.Child">
    <td>{{Son.Name}}
  </tr>
  <tr ng-repeat-end ng-repeat="grandSon in Son.Child">
    <td>{{grandSon.Name}}
  </tr>
  <tr ng-repeat-end ng-hide="true">
</table>

享受...