title: Clear errors in angularjs forms
body: <p>I have a form field that is required and email type. I want the form validation work when I lose focus from my field, so I am using:  ng-model-options="{ updateOn: 'blur' }"</p>
  
  <p>example:</p>
  
  <pre><code>&lt;input class="sng-size-input" type="email" required
                              ng-keyup="clearValidation(emailform.email_interface_form,emailform.email_interface_form.fromAddress)"
                              ng-model="emailSelectedValue.fromAddress" name="fromAddress"
                              ng-model-options="{ updateOn: 'blur' }"
                              value="{{emailSelectedValue.fromAddress}}"
                              ng-disabled="!emailSelectedValue.enabled" id="emailFromAddress"&gt;
                              &lt;span class="sng_form_error"
                              ng-show="emailform.email_interface_form.fromAddress.$error.email"
                              data-i18n="Not Valid e-mail"&gt; &lt;/span&gt; &lt;span
                              class="sng_form_error"
                              ng-show="emailform.email_interface_form.fromAddress.$error.required"
                              data-i18n="Required"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>when back to the field and start typing again I want my errors messages to disappear, so I am using:</p>
  
  <p>$rootScope.clearValidation = function(form,field){
        field.$setPristine(true);</p>
  
  <p>};</p>
  
  <p>my red css on the field disappears, but the error messages are not.
  What am I missing?</p>
  
  <p>my css:</p>
  
  <pre><code>.form-validation .ng-invalid.ng-dirty {
      border-color: #e94b3b;
  }
  </code></pre>
  
  <p>Thanks,</p>