title: angularjs enable submit button when validate confirm message
body: <p>I have the following register page </p>
  
  <pre><code>&lt;div class="col-md-6 col-md-offset-3"&gt;
      &lt;h2&gt;Add New User&lt;/h2&gt;
      &lt;form name="form" ng-submit="vm.register()" role="form"&gt;
          &lt;div class="form-group"
              ng-class="{ 'has-error': form.type.$dirty &amp;&amp; form.type.$error.required }"&gt;
              &lt;label for="type"&gt;User Type&lt;/label&gt;
              &lt;md-radio-group ng-init="vm.user.type=0" ng-model="vm.user.type" required&gt; 
                  &lt;md-radio-button value="0" class="md-primary"&gt;Back Office&lt;/md-radio-button&gt; 
                  &lt;md-radio-button value="1" class="md-primary md-hue-1"&gt; Mobile &lt;/md-radio-button&gt; 
                  &lt;md-radio-button value="2" class="md-primary md-hue-2"&gt;Client&lt;/md-radio-button&gt; 
              &lt;/md-radio-group&gt;
          &lt;/div&gt;
          &lt;div class="form-group" ng-class="{ 'has-error': form.firstname.$dirty &amp;&amp; form.firstname.$error.required }"&gt;
              &lt;label for="firstname"&gt;First name&lt;/label&gt; 
              &lt;input type="text" name="firstname" id="firstname" class="form-control" ng-model="vm.user.firstname" required /&gt; 
              &lt;span ng-show="form.firstname.$dirty &amp;&amp; form.firstname.$error.required" class="help-block"&gt;First name is required&lt;/span&gt;
          &lt;/div&gt;
          &lt;div class="form-group" ng-class="{ 'has-error': form.lastName.$dirty &amp;&amp; form.lastName.$error.required }"&gt;
              &lt;label for="lastname"&gt;Last name&lt;/label&gt; 
              &lt;input type="text" name="lastname" id="Text1" class="form-control" ng-model="vm.user.lastname" required /&gt; 
              &lt;span ng-show="form.lastname.$dirty &amp;&amp; form.lastname.$error.required" class="help-block"&gt;Last name is required&lt;/span&gt;
          &lt;/div&gt;
          &lt;div class="form-group" ng-class="{ 'has-error': form.lastName.$dirty &amp;&amp; form.lastName.$error.required }"&gt;
              &lt;label for="company"&gt;Company&lt;/label&gt; 
              &lt;input type="text" name="company" id="Text2" class="form-control" ng-model="vm.user.company" required /&gt; 
              &lt;span ng-show="form.company.$dirty &amp;&amp; form.company.$error.required" class="help-block"&gt;Company is required&lt;/span&gt;
          &lt;/div&gt;
  
          &lt;div class="form-group" ng-class="{ 'has-error': form.Email.$dirty &amp;&amp; form.Email.$error.required }"&gt;
              &lt;label for="email"&gt;Email&lt;/label&gt; 
              &lt;input type="text" name="email" id="Text2" class="form-control" ng-model="vm.user.email" ng-pattern="/\s?^[a-z]+[a-z0-9._]+@[a-z]+\.[a-z.]{2,5}$/i" required /&gt;
              &lt;span ng-show="form.email.$dirty &amp;&amp; form.email.$error.required"
                  class="help-block"&gt;Email is required&lt;/span&gt; 
                  &lt;span class="help-block" ng-show="form.email.$dirty &amp;&amp; form.email.$error.pattern"&gt; Not  valid email! &lt;/span&gt;
          &lt;/div&gt;
          &lt;div class="form-group" ng-class="{ 'has-error': form.username.$dirty &amp;&amp; form.username.$error.required }"&gt;
              &lt;label for="username"&gt;Username&lt;/label&gt; 
              &lt;input type="text" name="username" id="username" class="form-control" ng-model="vm.user.username" required /&gt; 
              &lt;span ng-show="form.username.$dirty &amp;&amp; form.username.$error.required" class="help-block"&gt;Username is required&lt;/span&gt;
          &lt;/div&gt;
          &lt;div class="form-group" ng-class="{ 'has-error': form.password.$dirty &amp;&amp; form.password.$error.required }"&gt;
              &lt;label for="password"&gt;Password&lt;/label&gt; 
              &lt;input type="password" name="password" id="password" class="form-control" ng-model="vm.user.password" required /&gt; 
              &lt;span ng-show="form.password.$dirty &amp;&amp; form.password.$error.required" class="help-block"&gt;Password is required&lt;/span&gt;
          &lt;/div&gt;
          &lt;div class="form-group" ng-class="{ 'has-error': form.confirmpassword.$dirty &amp;&amp; form.confirmpassword.$error.required }"&gt;
              &lt;label for="confirmpassword"&gt;Confirm Password&lt;/label&gt; 
              &lt;input type="password" name="confirmpassword" id="confirmpassword" class="form-control" ng-model="vm.user.confirmpassword" valid-password-c required /&gt; 
              &lt;span ng-show="form.confirmpassword.$dirty &amp;&amp; form.confirmpassword.$error.required" class="help-block"&gt;Confirm Password is required&lt;/span&gt;
              &lt;span ng-show="!form.confirmpassword.$error.required &amp;&amp; form.confirmpassword.$error.noMatch &amp;&amp; form.confirmpassword.$dirty" class="help-block"&gt;Passwords do not match.&lt;/span&gt;
          &lt;/div&gt;
          &lt;div class="form-actions"&gt;
              &lt;button type="submit" ng-disabled="form.$invalid"   class="btn btn-primary"&gt;Register&lt;/button&gt;
              &lt;img ng-if="vm.dataLoading" src="data:image/gif;base64,R0lGODlhEAAQAPIAAP///wAAAMLCwkJCQgAAAGJiYoKCgpKSkiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA==" /&gt;
              &lt;a href="#/login" class="btn btn-link"&gt;Cancel&lt;/a&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I have 2 problems 
  1- the Register button is always disabled even if I filled the all fields.
  2- during confirm password validation
  If I fill the password then fill the confirmpassword with the same value every thing will be good, but if I modified my password again the page will not show that the two passwords is not match</p>