title: Examine $dirty and $invalid for Dynamic Field Names in Angular JS version 1.1.5
body: <p>I have dynamic field names such as below: Here field names are coming from the controller and are generated dynamically. I am trying to do  validations and I want to print $dirty and $invalid flag for them. </p>
  
  <pre><code>&lt;div ng-repeat="fruit in fruits"&gt;
  &lt;ng-form name="myForm"&gt;
  **dirty: {{myForm.fruitId_[fruit.fruitname].$dirty}}
  invalid: {{myForm.fruitId_[fruit.fruitname].$invalid}}**
  </code></pre>
  
  <p>
                  
                      This field is required
                      Please enter at the most 8 characters
                  
      
      </p>
  
  <p>Here the below two statements : </p>
  
  <pre><code>**dirty: {{myForm.fruitId_[fruit.fruitname].$dirty}}
  invalid: {{myForm.fruitId_[fruit.fruitname].$invalid}}**  
  </code></pre>
  
  <p>Don't display anything. I appreciate your inputs.</p>
  
  <p>Here is the plunker : <a href="http://plnkr.co/edit/ehe3mNknCXV5PzDrxl8z?p=preview" rel="nofollow">http://plnkr.co/edit/ehe3mNknCXV5PzDrxl8z?p=preview</a></p>
  
  <p><strong>FIX:</strong> 
  I figured that angular needs {{}} for the field name in version1.1.5 and these brackets need to be escaped too. </p>
  
  <pre><code>&lt;ng-form name="myForm"&gt; 
        &lt;div ng-repeat="fruit in fruits"&gt;
  
         dirty: {{myForm['\{\{fruit.fruitname\}\}'].$dirty}}
         invalid: {{myForm['\{\{fruit.fruitname\}\}'].$invalid}} 
         {{fruit.fruitname}} Textbox: &lt;input type="text" name="{{fruit.fruitname}}" auto-id="fruitId_{{color}}_{{fruit.fruitname}}" ng-required="true" ng-maxlength="8" ng-model="data[fruit.fruitname]"  /&gt;
                  &lt;div class="validation-message" ng-show="myForm['\{\{fruit.fruitname\}\}'].$dirty &amp;&amp; myForm['\{\{fruit.fruitname\}\}'].$invalid"&gt;
                      &lt;span ng-show="myForm['\{\{fruit.fruitname\}\}'].$error.required"&gt;This field is required&lt;/span&gt;
                      &lt;span ng-show="myForm['\{\{fruit.fruitname\}\}'].$error.maxlength"&gt;Please enter at the most 8 characters&lt;/span&gt;
                  &lt;/div&gt;
  
         &lt;/div&gt;
  
    &lt;/ng-form&gt;
  </code></pre>
  
  <p>I updated the plunker with working version - <a href="http://plnkr.co/edit/SmwXXI38mgED7UJNtjuE?p=preview" rel="nofollow">http://plnkr.co/edit/SmwXXI38mgED7UJNtjuE?p=preview</a>. </p>