我正在使用ng-repeat
创建多个复选框。如果使用表单验证选中任何一个复选框,如何验证此表单?
<div class="checkbox" ng-repeat="nereg in northeastRegion track by $index" ng-click="nereg.selected = !nereg.selected">
<input type="checkbox" ng-checked="nereg.selected" >
<label for="">{{nereg.title}}</label>
</div>
JS
$scope.northeastRegion = [{
title: 'New England',
selected: false
},
{
title: 'New York Metro',
selected: false
},
{
title: 'Philly Tri-State',
selected: false
},
{
title: 'Upstate New York',
selected: false
},
{
title: 'Washignton',
selected: false
}
];