title: Set validation for dynamic field
body: <p>I have a form where the user can add fields dynamically. It is my html:</p>
  
  <pre><code>&lt;body ng-controller="FruitController"&gt;
      &lt;button type="button" ng-click="addFruit()"&gt;Add fruit&lt;/button&gt;
      &lt;form name="list"&gt;
        &lt;div id="dynamicList" ng-repeat="fruit in fruits"&gt;
          &lt;input type="text" name="fruitName" ng-model="fruit.name" ng-minlength="3"/&gt;
        &lt;/div&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>And it is my controller:</p>
  
  <pre><code>app.controller('FruitController', [function(){
  
    $scope.fruits = [
      {name: 'Apple', color: 'red'} 
    ];
  
    $scope.addFruit = function()
    {
      $scope.fruits.push({name: '', color: ''});
    };
  }]);
  </code></pre>
  
  <p>So, when a field is invalid i add a css class with the next directive:</p>
  
  <pre><code>ng-class="{'uk-form-danger': (list.fruitName.$invalid &amp;&amp; !list.fruitName.$pristine)}"
  </code></pre>
  
  <p>The problem is that, when 1 field fails, another fields too.
  Any ideas ?</p>