title: Why does setting ng-model to undefined not make the form/input valid again?
body: <p>I have the following simple form with an type='email' input bound to a model:</p>
  
  <pre><code>&lt;div ng-app&gt;
      &lt;h2&gt;Clearing ng-model&lt;/h2&gt;
      &lt;div ng-controller="EmailCtrl"&gt;
          &lt;form name="emailForm" ng-submit="addEmail()"&gt;
              &lt;input type="email" name="email" ng-model="userEmail" placeholder="email@domain.com"&gt;
              &lt;span ng-show="emailForm.email.$invalid &amp;&amp; emailForm.email.$dirty"&gt;invalid email&lt;/span&gt;
              &lt;span ng-show="emailForm.$invalid"&gt;form invalid!&lt;/span&gt;
          &lt;/form&gt;
          &lt;br/&gt;
          &lt;button ng-click="clearViaUndefined()"&gt;clear via undefined&lt;/button&gt;
          &lt;button ng-click="clearViaNull()"&gt;clear via null&lt;/button&gt;
          &lt;button ng-click="clearViaEmptyString()"&gt;clear via empty string&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Suppose the user enters an invalid email but then clicks a 'Cancel' button...so the form needs to be reset.</p>
  
  <p>In the ng-click handler for the 'Cancel' button, if I set the value of the model to 'undefined' this does not change the input element's $valid property back to true (nor the form's for that matter).</p>
  
  <pre><code>function EmailCtrl($scope) {
  
      $scope.clearViaUndefined = function () {
          $scope.userEmail = undefined;
      };
  
      $scope.clearViaNull = function () {
          $scope.userEmail = null;
      };
  
      $scope.clearViaEmptyString = function () {
          $scope.userEmail = "";
      };
  }
  </code></pre>
  
  <p>If I set the value of the model to an empty string "" or to null, then the $valid property does get set back to true.</p>
  
  <p>Why is this?</p>
  
  <p>I have a JS Fiddle here demonstrating the behaviour:</p>
  
  <p><a href="http://jsfiddle.net/U3pVM/12830/" rel="nofollow">http://jsfiddle.net/U3pVM/12830/</a></p>