title: AngularJS: How to validate ng-repeat form fields
body: <p>The code below is my attempt to validate a list of values in a form. The values are in a table within an <code>ng-repeat</code> directive and should be validated as required. Any inputs will be appreciated.</p>
  
  <pre><code>&lt;form name="form1"&gt;
    &lt;table&gt;
      &lt;tr ng-repeat="param in params"&gt;
       &lt;td&gt;
          {{param.name}}
       &lt;/td&gt;
       &lt;td&gt;
           &lt;input name="i{{$index}}" ng-model="param.val" required /&gt;
           &lt;span style="color:red" ng-show="form1.i{{$index}}.$dirty &amp;&amp; form1.i{{$index}}.$invalid"&gt;
              &lt;span ng-show="form1.i{{$index}}.required"&gt;This field is required&lt;/span&gt;
           &lt;/span&gt;
         &lt;/td&gt;
       &lt;/tr&gt;
    &lt;/table&gt;
  &lt;/form&gt;
  </code></pre>