title: Get all form controls in angularjs
body: <p>What I would like to do is make all fields show their validation errors when:</p>
  
  <ul>
  <li>visiting and modifying a field so that its dirty state is triggered (the default), and also</li>
  <li>validating and triggering dirty when the submit is pressed</li>
  </ul>
  
  <p>Take the following form</p>
  
  <pre><code>&lt;div ng-form="MyForm"&gt;
    &lt;label&gt;
      &lt;input type="text" name="numbers" ng-required="'true'" ng-pattern="/^[0-9]*$/" ng-model="numbers" /&gt;
      &lt;span class="error" ng-show="numbers.$error.required"&gt;Required&lt;/span&gt;
      &lt;span class="error" ng-show="numbers.$error.pattern"&gt;Pattern&lt;/span&gt;
    &lt;/label&gt;
  
    &lt;label&gt;
      &lt;input type="text" name="characters" ng-required="'true'" ng-pattern="/^[a-z]*$/" ng-model="characters" /&gt;
      &lt;span class="error" ng-show="characters.$error.required"&gt;Required&lt;/span&gt;
      &lt;span class="error" ng-show="characters.$error.required"&gt;Pattern&lt;/span&gt;
    &lt;/label&gt;
  
    &lt;button ng-click="validateAndSubmit()"&gt;Submit&lt;/button&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Essentially, I would like to create a directive that validates (sets dirty to true) for all the controls in an arbitrary form. Is there a simple way to get the form controls from the <code>FormController</code> without finding the actual dom elements?</p>