title: Dynamically update 'max' validation in AngularJS
body: <p><strong>Edit: Massively simplified to get to the core of the problem</strong></p>
  
  <p>In Angular (v1.2.22) validation, if the value of <code>max</code> depends on another value, and that value updates, the validation state does not automatically update.</p>
  
  <pre><code>var app = angular.module('app',[]).
  controller('TestCtrl', function($scope){
    $scope.partWidth = 10;
  });
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form name="itemForm"&gt;
    &lt;label for="partWidth"&gt;Part width&lt;/label&gt;
    &lt;input id="partWidth" name="partWidth" min="10" max="180"  ng-model="partWidth" placeholder="mm" required type="number"&gt;
  
    &lt;label for="cutterwidth"&gt;Cutter width&lt;/label&gt;
    &lt;input id="cutterwidth" name="cutterwidth" min="10" max="{{ partWidth }}"  ng-model="cutterwidth" placeholder="mm" required type="number"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Updated Plunker
  <a href="http://plnkr.co/edit/lNemYyFrHF9gyRgY8KIT" rel="nofollow">http://plnkr.co/edit/lNemYyFrHF9gyRgY8KIT</a></p>
  
  <p>The <code>ng-invalid</code> class is not removed unless the <code>cutterwidth</code> itself is edited.</p>
  
  <p>a) Is this a bug?</p>
  
  <p>b) Is there a workaround? (e.g. force validation to run, somehow trigger the input event etc)</p>