title: Changes in the ng-model value doesn't get propagated to element value in angular js
body: <p>Below is the issue that I was facing and while going through the code I realized that the ng-model get's updated but the element for the same input field doesn't.
  what is the reason and solution for the same.
  below are the details of the issue faced due to this.</p>
  
  <p>Currently I have an input field where the user enters a phone number. I'm formatting the number and updating the scope simultaneously.The formatting starts when the user enters 7 digits. The model value gets updated, however the cursor remains at the same point where it was before formatting (the 7th pos. in this case).</p>
  
  <p>Below is the function I am calling on ng-change:</p>
  
  <pre><code> $scope.FormatNumber =function(){
          var userID=$scope.phoneNumber.replace(/[^\w\@\.]/g, '');
          userID=  userID.replace(/\s/g,'');
          $log.info(userID);
          if(isNaN(userID)){
              $scope.phoneNumber=userID;
              return;
          }
          else if(userID.length &lt; 7 || userID.length&gt;10){
              $scope.phoneNumber=userID;
          }
          else if((userID.length &gt; 6 &amp;&amp; userID.length&lt;11))  {
              ascii=[];
              //alert("length :"+$scope.phoneNumber.length);
              for (var i = 0, len = userID.length; i &lt; len; i += 1) {
                 if(ascii.length == 0){
                      ascii[0]="(";
                  }
                  else if(ascii.length ==4){
                      ascii[4]=")";
                      ascii[5]=" ";
                  }
                  else if(ascii.length ==9){
                      ascii[9]="-";
                  }
                      ascii.push(+userID.charAt(i));
  
  
  
                  var formattedNumber=ascii.join().replace(/[,]/g, '');
                  $scope.phoneNumber=formattedNumber ;
  
  
  
              }}
  
      };
  </code></pre>
  
  <p>This issue is only occurring in Chrome; it's working fine in Mozilla.
  Moreover it's only there when formatting takes place for the first time.
  Even if you enter the next value at the wrong place, the cursor gets updated to end of text.</p>