title: AngularJS - Reset form using $setPristine() when all controls are emptied
body: <p>I'm trying to create a reusable directive that will simply reset my form and it's child controls to pristine using the <a href="https://github.com/angular/angular.js/commit/733a97adf87bf8f7ec6be22b37c4676cf7b5fc2b" rel="nofollow">$setPristine()</a> method IF all the form's input controls are emptied after the user has previously interacted with them and marked them dirty.</p>
  
  <p>So basically the directive would monitor all the form <code>&lt;input&gt;</code> elements and if it determines all elements are empty call <a href="https://github.com/angular/angular.js/commit/733a97adf87bf8f7ec6be22b37c4676cf7b5fc2b" rel="nofollow">$setPristine()</a> to reset everything back to square one.</p>
  
  <p>This seems kind of trivial and something I could bust out with jQuery in 5 mins but I'm just getting my feet wet with Angular and I've been stumbling around this for a couple of hours struggling with the best approach so any help or guidance is greatly appreciated!</p>