title: AngularJS - dynamic naming using $index in expression
body: <p>I have a directive in which i create many <code>ng-form</code>'s and i name each form based on the <code>$index</code> (from the <code>ng-repeat</code>). My problem is that i want to show an error container (that contains the error message) when the <strong>form</strong> is invalid but i cant find how to properly reference the form.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;ng-form name="innerForm{{$index}}"&gt;
  
      &lt;label ... &gt;&lt;input name="input" ... /&gt;
  
          &lt;div class="error-container" ng-show="'innerForm'+$index.input.$invalid"&gt;
                 // show the error message
          &lt;/div&gt;
  
  &lt;/ng-form&gt;
  </code></pre>
  
  <p>I want <code>'innerForm'+$index.input.$invalid</code> to be evaluated as <code>innerForm5.input.$invalid</code> for example. </p>
  
  <p>I have made many attempts but i can't get it to work. What is the correct way to reference my dynamically named form?</p>