title: Calling angular $setValidity in controller
body: <p>I have an input field and a button where a user enters an address to be geolocalized. It's part of a bigger form but I wish the validity of that field to be handled when they presss the "Map it" button instead of the final form submit.  How can I set this field as invalid? Calling <code>$setValidity</code> results in an undefined/not a function error.</p>
  
  <p>Form bit:</p>
  
  <pre><code>&lt;form name="myForm"&gt;
    &lt;input type="text" name="addy" ng-model="addy"&gt;
    &lt;a ng-click="geoCode()"&gt;Map it!&lt;/a&gt;
    &lt;span class="error" ng-hide="myForm.addy.$invalid"&gt;Bad field&lt;/span&gt;
    ....
  &lt;/form&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>$scope.addy = null
  
  // This is a more complex async function trimmed down to essentials
  $scope.geoCode = function() {
    $scope.addy.$setValidity('unique', false);
  });
  </code></pre>
  
  <p>I'd also like that field to only be checked once. So if they enter an address and do not press the Map it button then it will be checked on submit, but if they did press the Map button and field is valid then it will not run through the async function again. Suggestions as to how to best handle this?</p>