我正在使用ng-repeat对现有循环的childArray进行迭代(ng-repeat),但我希望在我的孩子ng-repeat上显示空白结果 . 有没有办法做到这一点?我有一个元素结构,我想从孩子ng-repeat中显示出来 .
代码如下所示:
<ng-repeat="row in parentArray"> <--- the parent array
{{row.name}}
{{row.date}}
{{row.place}}
<ng-repeat="option in row"> <--- the child array
Result : {{option.name}} <-- I still want result to show up
</ng-repeat>
</ng-repeat>
1 回答
如果我理解正确的话,如果没有选择,你想展示一些东西吗?
ng-repeat
仅适用于数据 . 没有数据时,不显示任何内容 . 为此,您可以使用ng-if
或ng-show
/ng-hide
此外,我目前还不清楚选项存储在行中的位置
HTML