AngularJS-将ng重复插入两个TR之间的另一个TR中

AngularJS-将ng重复插入两个TR之间的另一个TR中,angularjs,angularjs-ng-repeat,ng-repeat,Angularjs,Angularjs Ng Repeat,Ng Repeat,我的问题很简单 我有一张桌子,一张经典的桌子。在这个表中,我想显示两个名为networks和channels的数组的值 网络中的每个网络可以包含频道,但并非所有频道 我想要的是显示所有网络及其相关频道 在DIV或TD中TR很简单,但我不能用多个TR来实现这一点 例如: {{network.Name} {{channel.Name} 工作起来很有魅力 但我在搜索这样的东西: <tr ng-repeat="network in networks"> <td>{{

我的问题很简单

我有一张桌子,一张经典的桌子。在这个表中,我想显示两个名为networkschannels的数组的值

网络中的每个网络可以包含频道,但并非所有频道

我想要的是显示所有网络及其相关频道

DIVTDTR很简单,但我不能用多个TR来实现这一点

例如:


{{network.Name}
{{channel.Name}
工作起来很有魅力

但我在搜索这样的东西:

<tr ng-repeat="network in networks">
     <td>{{network.Name}}</td>
     <td ng-repeat="month in year">{{month.Name}}</td>
</tr>
<tr ng-repeat="channel in channels | filter: { networkId: network.networkId}">
     <td>{{channel.Name}}</td>
     <td ng-repeat="month in year">{{month.Name}}</td>
</tr>

{{network.Name}
{{month.Name}
{{channel.Name}
{{month.Name}
但我知道这不是一个很好的代码:)

有人知道怎么做吗? 我不想通过DIV更改


亲切的问候

每个
ng repeat
都有自己的作用域,因此您的网络在第二次
TR
repeat时不可用

如果您真的想坚持使用表,可以在tr中创建一个表,如下所示:

<tr ng-repeat="network in networks">
     <td>{{network.Name}}</td>
     <td ng-repeat="month in year">{{month.Name}}</td>
     <td>             
         <table>
            <tr ng-repeat="channel in channels | filter: { networkId: network.networkId}">
               <td>{{channel.Name}}</td>
             </tr>
         </table>
     </td>
</tr>

{{network.Name}
{{month.Name}
{{channel.Name}

我无法在TR中使用表格,因为会显示其他TD。完整的行代码是:
{{network.Name}{{{month.Name}{{{channel.Name}}{{{month.Name}}
注释中的代码不可读,请用它更新您的问题好吗@Niveklr检查更新,如果是这种情况,我认为您最好离开表,因为使用这种方法@NivekLROK时UI看起来不太好。谢谢你抽出时间。我会做的:)
<tr ng-repeat="network in networks">
     <td>{{network.Name}}</td>
     <td ng-repeat="month in year">{{month.Name}}</td>
     <td>             
         <table>
            <tr ng-repeat="channel in channels | filter: { networkId: network.networkId}">
               <td>{{channel.Name}}</td>
             </tr>
         </table>
     </td>
</tr>