How do I bind to list of checkbox values with AngularJS?

前端 未结 29 2328
天涯浪人
天涯浪人 2020-11-22 05:20

I have a few checkboxes:





        
29条回答
  •  攒了一身酷
    2020-11-22 06:03

    You can combine AngularJS and jQuery. For example, you need to define an array, $scope.selected = [];, in the controller.

    
    

    You can get an array owning the selected items. Using method alert(JSON.stringify($scope.selected)), you can check the selected items.

提交回复
热议问题