Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/30.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
Angular 角度的嵌套表问题?_Angular_Angular7 - Fatal编程技术网

Angular 角度的嵌套表问题?

Angular 角度的嵌套表问题?,angular,angular7,Angular,Angular7,我的工作结构是正确显示组和请求。现在我也有组外的requestDetails。我无法按要求正确显示。(我在json中有两个位置请求详细信息,需要按照快照显示。) 下面提到的代码显示了请求的组和数量 <ng-container *ngFor="let groupRowData of data.SolutionsDetail[0].groups;"> <ng-container *ngFor="let requestDetailData of groupRowData.req

我的工作结构是正确显示组和请求。现在我也有组外的requestDetails。我无法按要求正确显示。(我在json中有两个位置请求详细信息,需要按照快照显示。)

下面提到的代码显示了请求的组和数量

<ng-container *ngFor="let groupRowData of data.SolutionsDetail[0].groups;"> 
  <ng-container *ngFor="let requestDetailData of groupRowData.requestDetails; let $index = index">
    <tr>
      <td *ngIf="$index===0;" [attr.rowspan]="groupRowData.requestDetails.length">Group {{ groupRowData.GroupId }}</td>
      <td>
        {{ requestDetailData.ReqId}}
      </td>
    </tr>
  </ng-container>
</ng-container>


组{groupRowData.GroupId}
{{requestDetailData.ReqId}
我就是这样解决的


组{groupRowData.GroupId}
{{requestDetailData.ReqId}
NA
{{RowData.ReqId}
<ng-container *ngFor="let groupRowData of data.SolutionsDetail[0].groups;"> 
  <ng-container *ngFor="let requestDetailData of groupRowData.requestDetails; let $index = index">
    <tr>
      <td *ngIf="$index===0;" [attr.rowspan]="groupRowData.requestDetails.length">Group {{ groupRowData.GroupId }}</td>
      <td>
        {{ requestDetailData.ReqId}}
      </td>
    </tr>
  </ng-container>
</ng-container>

<table border=1>
<ng-container *ngFor="let groupRowData of data.SolutionsDetail[0].groups;"> 

  <ng-container *ngFor="let requestDetailData of groupRowData.requestDetails; let $index = index">
    <tr>
      <td *ngIf="$index===0;" [attr.rowspan]="groupRowData.requestDetails.length">Group {{ groupRowData.GroupId }}</td>
      <td>
        {{ requestDetailData.ReqId}}
      </td>
    </tr>
  </ng-container>
</ng-container>
<ng-container  *ngFor="let RowData of data.SolutionsDetail[0].requestDetails; let $index = index">
<tr>
      <td *ngIf="$index===0;" [attr.rowspan]="data.SolutionsDetail[0].requestDetails.length">NA</td>
      <td>
        {{ RowData.ReqId}}
      </td>
    </tr>
</ng-container>
</table>