Angularjs 故意显示空白ng重复(对于嵌套数组)
我正在使用ng repeat对现有循环的childArray进行迭代(ng repeat),但我希望在我的childng repeat上显示空白结果。有办法吗?我有一个元素结构,我想从子元素ng repeat中显示出来 代码如下所示:Angularjs 故意显示空白ng重复(对于嵌套数组),angularjs,angularjs-ng-repeat,Angularjs,Angularjs Ng Repeat,我正在使用ng repeat对现有循环的childArray进行迭代(ng repeat),但我希望在我的childng repeat上显示空白结果。有办法吗?我有一个元素结构,我想从子元素ng repeat中显示出来 代码如下所示: <ng-repeat="row in parentArray"> <--- the parent array {{row.name}} {{row.date}} {{row.place}} <ng-repeat="option i
<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>
如果我理解正确,如果没有选择,你想展示一些东西吗
ng repeat
仅适用于数据。没有数据时,不显示任何内容。为此,如果或ng show
/ng hide
此外,我目前还不清楚选项存储在行中的什么位置
HTML
如果我理解正确的话,如果没有选择的话,你想展示一些东西吗
ng repeat
仅适用于数据。没有数据时,不显示任何内容。为此,如果或ng show
/ng hide
此外,我目前还不清楚选项存储在行中的什么位置
HTML
这还不清楚。您希望在存在选项但未设置名称的情况下显示空白结果,还是在不存在选项的情况下显示空白结果?第一个应该是当前结果,第二个只是。。。令人困惑请给我们一些上下文。基本上,在父数组上有时有一个属性,其中的值是选项的子数组。目前,我的第二次ng重复将不会显示数据。这一点尚不清楚。您希望在存在选项但未设置名称的情况下显示空白结果,还是在不存在选项的情况下显示空白结果?第一个应该是当前结果,第二个只是。。。令人困惑请给我们一些上下文。基本上,在父数组上有时有一个属性,其中的值是选项的子数组。目前,我的第二次ng重复将不显示数据
<ng-repeat="row in parentArray"> <--- the parent array
{{row.name}}
{{row.date}}
{{row.place}}
<div ng-if="row.options.length > 0">
<ng-repeat="option in row.options"> <--- the child array
Result : {{option.name}} <-- I still want result to show up
</div>
<div ng-if="row.options.length === 0">
<label>No Data</label>
</div>
</ng-repeat>