Angular 多输入角度6

Angular 多输入角度6,angular,Angular,我无法发送新值​​到后端 在php后端中获取“config”: 0:{id: "basic1", legend: "Basic 1", limit: 3, pos: 1} 1:{id: "basic2", legend: "Basic 2", limit: 3, pos: 2} 2:{id: "basic3", legend: "Basic 3", limit: 3, pos: 3} 设置FormBuilder: this.categoryForm = this.formBuilder.gro

我无法发送新值​​到后端

在php后端中获取“config”:

0:{id: "basic1", legend: "Basic 1", limit: 3, pos: 1}
1:{id: "basic2", legend: "Basic 2", limit: 3, pos: 2}
2:{id: "basic3", legend: "Basic 3", limit: 3, pos: 3}
设置FormBuilder:

this.categoryForm = this.formBuilder.group({
  pos: ['', Validators.required],
  limit: ['', Validators.required]
});
打印html:

<form [formGroup]="categoryForm" (ngSubmit)="saveCategory()">
    <tr *ngFor="let data of config; let i = index;" class="d-flex">
      <td class="col-1"><i class="material-icons hand" (click)="categoryExcluirOpen(categoryDelete,i)">delete_forever</i></td>
      <td class="col-3"><input type="text" class="form-control" placeholder="_" formControlName="pos" [value]="data.pos" maxlength="7"></td>
      <td class="col-5">{{data.legend}}</td>
      <td class="col-3"><input type="text" class="form-control" placeholder="_" formControlName="limit" [value]="data.limit" maxlength="7"></td>
    </tr>
</form>
我编辑这些值​​它们不会被带到后端

saveCategory()
必须是一个需要在ComponentClass上定义的方法。它不会直接调用服务的方法

我假设
this.config
将是一个具有
id
legend
属性的对象。您希望表单中有
限制
位置

在组件类中添加名为
saveCategory()
的方法


即使价值观​​你的问题一点也不清楚。你能考虑创建一个StackBlitz项目来演示这个问题吗?他没有接受这些值
this.categoryService.saveCategory(this.config)
    .subscribe(
      data => {
        this.loading = false;
        console.log(data);
      }, error => {});
saveCategory() {
  const configToStore = {
    ...this.config,
    ...this.categoryForm.value
  }
  this.categoryService.saveCategory(configToStore)
    .subscribe(
      data => this.loading = false, 
      error => {}
    );
}