I have a form that it repeated in a ng-repeat. I put part of my form in blow. for custom validation I want to use $setValidity in controller. But I cant to get input name by index in controller. How I use $scope.form.name1.$setValidity("size", false) and other input element?
<form name="form">
<div ng-repeat="item in items track by $index">
<input name='name{{$index}}' ng-model="name{{$index}}">
</div>
</form>
function validation(index){
if(...){
$scope.form.name.$setValidity("size", false); // form.name0 and form.name1 and ...
}
}