title: Angular js set form to Pristine false
body: <p>I've a html form and I'm adding validation to each input within the from using angular js.</p>
  
  <p>But I don't want to show the validation error initially when the html loads, until the user makes some changes in the form.</p>
  
  <p>So I've validation like:</p>
  
  <pre><code>&lt;form name="addApplicationForm" accept-charset="UTF-8" novalidate&gt;
      &lt;input type="text" name="name" ng-model="applicationData.application_name" required&gt;
      &lt;div ng-show="addApplicationForm.name.$invalid &amp;&amp; !addApplicationForm.name.$pristine"&gt;
        &lt;span class="error" ng-show="addApplicationForm.name.$error.required"&gt;Please enter application name.&lt;/span&gt;
      &lt;/div&gt;
      &lt;button ng-click="submit()"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And this form works as I expected. Now if the user directly clicks the submit button without making any change in the input, the $pristine state is still true and the error does now shows. But here I want to show the validation error to the user.</p>
  
  <p>That's why on submit, I want to set the $pristine state of the form to false, but I'm not seeing a method for it.</p>
  
  <p>I also tried with $dirty instead of $pristine like: </p>
  
  <pre><code>&lt;form name="addApplicationForm" accept-charset="UTF-8" novalidate&gt;
      &lt;input type="text" name="name" ng-model="applicationData.application_name" required&gt;
      &lt;div ng-show="addApplicationForm.name.$invalid &amp;&amp; !addApplicationForm.name.$dirty"&gt;
        &lt;span class="error" ng-show="addApplicationForm.name.$error.required"&gt;Please enter application name.&lt;/span&gt;
      &lt;/div&gt;
      &lt;button ng-click="submit()"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>And on submit I just call the setDirty method to make the form dirty and thus it shows the error on the submit button click.</p>
  
  <p>But here the problem is, I also have a reset button in the form. Once clicked, I want to clear all the fields of the form and then I need to make the dirty flag of the form to false but I don't have any such option. But for this case if I use $pristine I've $setPristine().</p>
  
  <p>So in this case whatever I use $dirty or $pristine, I've one issue here.</p>
  
  <p>Please tell me what could be the solution.</p>