Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/390.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/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
Javascript 以角度显示表中的数组数据_Javascript_Arrays_Angular - Fatal编程技术网

Javascript 以角度显示表中的数组数据

Javascript 以角度显示表中的数组数据,javascript,arrays,angular,Javascript,Arrays,Angular,我有一个数组f objects,其中包含一个名为dest的属性,该dest属性包含另一个对象数组,我正试图以可编辑html表格的形式以角度显示该数组。下面是数据的样子。现在我知道如何在javascript中使用2D数组,但我无法在html表中正确使用它。表中有4列,每列分别命名为“旁遮普-旁遮普、信德省-信德省、俾路支省-俾路支省和首都-首都”。在每个列下有4行,如Punjab-Punjab下,在dest数组中有表示第0个索引数据的文本框。这是我的html <div *ngIf="

我有一个数组f objects,其中包含一个名为
dest
的属性,该dest属性包含另一个对象数组,我正试图以可编辑html表格的形式以角度显示该数组。下面是数据的样子。现在我知道如何在javascript中使用2D数组,但我无法在html表中正确使用它。表中有4列,每列分别命名为“旁遮普-旁遮普、信德省-信德省、俾路支省-俾路支省和首都-首都”。在每个列下有4行,如
Punjab-Punjab
下,在
dest
数组中有表示第0个索引数据的文本框。这是我的html

<div *ngIf="enableCombinationDirective">
  <div fxLayout="row">
      <div class="h1">Add Prices</div>
      <form [formGroup]="combinationForm">
        <table style="width: 100%; border: 1px solid grey;">
          <tr>
            <td *ngFor="let item of combinationForm.get('dest')['controls']; let i = index">
              {{ combinationForm.get("dest")["controls"][i].get("combinationTitle").value}}
            </td>
          </tr>
          <tr>
            <td *ngFor="let item of combinationForm.get('dest')['controls']; let i = index">
              <div [formGroup]="combinationForm">
                <div formArrayName="dest">
                  <div fxLayout="row wrap" class="pt-4" fxLayoutAlign="space-evenly">
                    <mat-form-field appearance="outline" [formGroupName]="i" style="width: 40% !important;" apprearance="outline" fxFlex="50">
                      <mat-label>{{ combinationForm.get("dest")["controls"][i].get("combinationTitle").value}}</mat-label>
                      <input matInput type="number" #destInput formControlName="price" placeholder="Enter Price"/>
                      <mat-checkbox formControlName="isActive" matSuffix></mat-checkbox>
                    </mat-form-field> 
                  </div>
                </div>
              </div>
            </td>
          </tr>
        </table>
      </form>
  </div>
</div>

加价
{{combinationForm.get(“dest”)[“controls”][i].get(“combinationTitle”).value}
{{combinationForm.get(“dest”)[“controls”][i].get(“combinationTitle”).value}

我正试着用FormArray来展示桌子。如何解决此问题?

我需要html绑定方面的帮助,我认为我做错了