My intention is to watch a model within scope, and find difference between old value and new value.
However, I found old value and new value are all the same from th
I found that it's very useful to check if the new and old value are equal (in values) and skip the process if that's the case to avoid unexpected behavior. You can use angular.equals to achieve that. Here's an example:
JS:
$scope.$watch('myObject', function(newValue, oldValue){
if(angular.equals(newValue, oldValue)){
return; // simply skip that
}
});