$observe is a method of the attribute object that listens for changes in the property values in the DOM. For example attr1= "{{name}}"
attribute is defined on the third parameter of the link function in directive. So $observe can only be used in directive.
You can see that its callback function has only one parameter, which is the new value.
function () { return { function(scope, element, attrs) { attrs. $observe ( function(newval) { //.... }) } } })
Summarized as follows:
$observe can only be used in directive, $watch not so many restrictions, $watch is the method on the scope object, so it can be used in the Controller or directive link method.
$observe can only be monitored for changes in DOM property values, $watch can listen to an expression, which can be a function or a string. If it is a string, it is converted to a function using $parse. String expression cannot contain {{}}.
$observe callback functions are newvalue, $watch have oldvalue and newvalue
Use of $watch and $observe