title: generate alert only if change took place
body: <p>i have a table with a <code>&lt;contenteditable&gt;</code> <code>&lt;td&gt;</code>, and i want to create alert only when change took place but i cant get it to work...when i try to compare value i end up comparing it to himself (i think) and alert always happens.
  this is my function:</p>
  
  <pre><code>$scope.saveCron = function(userId,scriptId,cronFormat){
          var pre = cronFormat;
          $.post("updateCronChange.php","user_id="+userId+"&amp;script_id="+scriptId+"&amp;cron_format="+cronFormat, function(data){
          $scope.demoData = userId + scriptId + cronFormat;
          angular.equals(pre,cronFormat){
          alert("user script settings table update the cron format to:"+cronFormat);}
      });
  }
  </code></pre>
  
  <p>and this is my table:</p>
  
  <pre><code>        &lt;table class="table table-bordered table-hover" ng-
  
      controller="tableCtrl"&gt;
                  &lt;thead&gt;
                  &lt;th&gt;user name&lt;/th&gt;
                  &lt;th&gt;script name&lt;/th&gt;
                  &lt;th&gt;cron format&lt;span class="glyphicon glyphicon-question-sign"  data-toggle="tooltip" data-original-title="Min|Hour|Day Of Month|Month|Day Of Week"&gt;&lt;/span&gt;&lt;/th&gt;
                  &lt;/thead&gt;
                  &lt;tbody ng-repeat="(user_id,script_id) in data"&gt;
                      &lt;tr ng-repeat="(script_id, cron_format) in script_id"&gt;
                          &lt;td class="userName"&gt;{{user(user_id)}}&lt;/td&gt;
                          &lt;td class="scriptName"&gt;{{script(script_id)}}&lt;/td&gt;
  &lt;td class="cronFormat"&gt;&lt;input type="text" ng-model="cron_format" ng-blur="saveCron(user_id,script_id,cron_format)"/&gt;&lt;/td&gt;                    &lt;/tr&gt;
                  &lt;/tbody&gt;
              &lt;/table&gt;
  </code></pre>
  
  <p>the function being called whenever moustout of the input field..how can i make it show the alert only when user changed the data in cron_format?</p>
  
  <p><strong>UPDATED THE FUNCTION</strong></p>