angularjs ng-repeat input fields ng-required not working

283 Views Asked by At

My ng-repeat input fields are dynamic fields, if checkbox checked the ng-repeat input fields are displaying, ADD More button also enabled. If i click the ADD More button same set of input fields are displaying, i need to validate my ng-repeat input fields at the time of checkbox status will be true (checked) using ng-required / required option.

Kindly give me a solution using ng-required = "true" / required.

Thank you.

1

There are 1 best solutions below

0
On

most probably you need to set the name on each checkbox something like

<div your ng-repeat>
    <input type="checkbox" name="chk{{$index}}" ng-model="yourmodel" ng-required="true" />
</div>