javascript - Angular Get Selected CheckBoxes -
i have list of dynamically filled checkboxes using angular.
<div ng-repeat="x in xlist"> <label>{{x.header}}</label> <input type="checkbox" name="x" value="{{x.item.id}}" /> <p>{{x.header}}</p> </div>
i want method retrieve list of selected checkboxes. i'd use
$('input[name=checkboxlist]:checked').each(function() { }
but not acceptable angular .... there appropriate method so?
here implemented plunker
<input type="checkbox" ng-model="selected[record.id]"> {{record.id}} $scope.showselected = function() { console.log($scope.selected); alert(json.stringify($scope.selected)); };
Comments
Post a Comment