title: Skip $asyncValidators until model is dirty
body: <p>I use <code>$asyncValidators</code> to validate a field value. The field value is fetched from server with <code>$resource</code>. On page load, the value is empty and the validator sends a request to the server. When <code>$resource</code> has fetched the resource, the field value is populated and the validator sends another request to the server.</p>
  
  <p>I would like to skip these two initial requests since they are useless. How do I do that?</p>
  
  <p>My input field:</p>
  
  <pre><code>&lt;input name="name" class="form-control" ng-model="user.name" validate-name&gt;
  </code></pre>
  
  <p>My directive:</p>
  
  <pre><code>angular.module('myapp').directive('validateName', function($http, $q) {
    return {
      require: 'ngModel',
      link: function(scope, element, attrs, ctrl) {
        ctrl.$asyncValidators.name = function(modelValue, viewValue) {
          return $http.post('/validate-username', {username: viewValue}).then(function(response) {
            if (!response.data.validUsername) {
              return $q.reject(response.data.errorMessage);
            }
            return true;
          });
        };
      }
    };
  });
  </code></pre>