How to get an Array with just the values from selected checkboxes?

前端 未结 2 1879
醉酒成梦
醉酒成梦 2021-01-26 04:37

How can I bind checkboxes to an array in my model, so that the array always contains just the values corresponding to the selected checkboxes?

For example, instead of:

2条回答
  •  情话喂你
    2021-01-26 05:37

    Use an ng-click or cg-change handler that adds/removes values from the array.

提交回复
热议问题