title: How to allow ng-click when button is disabled in Angularjs
body: <p>I have the following form:</p>
  
  <pre><code>&lt;form name="formuser" action='/signup' method='post' novalidate&gt;
  
      &lt;input type="text" name="firstname" ng-model="firstname" ng-class="{ 'has-error' : (formuser.firstname.$invalid &amp;&amp; !formuser.firstname.$pristine) || hasSubmitted}" required /&gt;
  
      &lt;button type="submit" ng-disabled="formuser.$invalid" ng-click="hasSubmitted=true"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I'm trying to add the class 'has-error' to the input field that is invalid after the user has either typed in something or hit the submit button while the input is still pristine. I've added ng-disabled to the submit button to disable the form submition but I still want the ng-click to fire to change the hasSubmitted scope. The problem is that ng-disable on the button also disabled the ng-click. </p>
  
  <p>I know I could always use ng-submit on the form, do validation in my controller, and then fire off an ajax request but my authentication framework requires that I actually submit the form and redirect the browser.</p>