title: How to disabled a button[update] when there is no changes in a form
body: <pre><code>&lt;form role="form" id="myForm" name="myForm"&gt;
    &lt;input class="form-control" ng-model="firstName" type="text" /&gt;
    &lt;input class="form-control" ng-model="lastName" type="text" /&gt; 
  
  &lt;button class="btn btn-info" ng-disabled="myForm.$pristine"&gt;cancel&lt;/button
  &lt;button class="btn btn-primary" ng-disabled="myForm.$pristine"&gt;update&lt;/button
  &lt;/form&gt;
  </code></pre>
  
  <p>Assume that there is a list of data in a table. 
  When I click a data, a modal will pop up with data on it(in the example the firstName and lastName). </p>
  
  <p>Inside the modal there’s an EDIT button that when u click it, two other buttons will appear -- <code>CANCEL</code> and <code>UPDATE</code>. I want to set the update button to disabled while there is no changes yet happening in the FORM. </p>
  
  <p>By using <code>$pristine</code> I found a solution, but there’s one problem:</p>
  
  <p>When I try to edit the data and decide to cancel it (by resetting the current data), the next time I click <code>EDIT</code> the <code>UPDATE</code> button is already enabled even though there are no changes to the data yet. </p>
  
  <p>Is there any solution for this?</p>