Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 故意显示空白ng重复(对于嵌套数组)_Angularjs_Angularjs Ng Repeat - Fatal编程技术网

Angularjs 故意显示空白ng重复(对于嵌套数组)

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对现有循环的childArray进行迭代(ng repeat),但我希望在我的childng 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>

如果我理解正确,如果没有选择,你想展示一些东西吗

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>