Currently, I am monitoring scope changes using a simple watch like this:
$scope.$watch('myObject', function(newValue, oldValue) {
if (newValue !== oldValue) {
return newValue;
}
}, true);
In this case, myObject
is an ordinary object with multiple properties. My goal is to only detect and return the specific property that has been modified, such as myObject.changedProperty
.
My preference is to keep track of the entire object without setting up separate watches for each individual property. Is there a way to achieve this?
Your insight on this matter would be highly appreciated!