Angular ReactiveForms: Producing an array of checkbox values?

前端 未结 12 650
执念已碎
执念已碎 2020-11-29 17:16

Given a list of checkboxes bound to the same formControlName, how can I produce an array of checkbox values bound to the formControl, rather than s

12条回答
  •  庸人自扰
    2020-11-29 17:50

    Related answer to @nash11, here's how you would produce an array of checkbox values

    AND

    have a checkbox that also selectsAll the checkboxes:

    https://stackblitz.com/edit/angular-checkbox-custom-value-with-selectall

提交回复
热议问题