I am facing an issue with my form that is being repeated in an ng-repeat. Below is a snippet of the form. I need to implement custom validation using $setValidity in the controller. However, I am struggling to access input names by index in the controller. How can I use $scope.form.name1.$setValidity("size", false) and apply it to other input elements?
<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); // Need to target specific input elements dynamically
}
}