On first run both values (newValue
and oldValue
) are equal, so you may easily escape it by checking for equality:
$scope.$watch("data_copy", function(newValue, oldValue) {
if(newValue === oldValue){
return;
}
alert("$watch triggered!");
});
PLUNKER