代码之家  ›  专栏  ›  技术社区  ›  Venomoustoad

如何在角度8中构建表单控件/组数组?

  •  0
  • Venomoustoad  · 技术社区  · 6 年前

    我有一个定制的需求,其中我有一个需要按特定顺序发送到表单的输入列表。

    <li *ngFor="let item of items; let i = index" dnd-sortable [sortableIndex]="i">
      <input  [value]= "item.name"></span>
      <select>
        <option [value] = 'color.name' *ngFor="let color of colors">{{color.name}}</option>
      </select>
      <tag-input theme='minimal'></tag-input>
    </li>
    

    我应该如何组织这些输入的表单组?我最理想的是 {'item': item_name, 'color': color_name, 'tags': [tag1, tag2, tag3]}

    0 回复  |  直到 6 年前