In the ngDraggable
project, I found this code in the directive ngDrag
.
attrs.$observe("ngDrag", onEnableChange);
scope.$watch(attrs.ngDrag, onEnableChange);
attrs.$observe('ngCenterAnchor', onCenterAnchor);
scope.$watch(attrs.ngCenterAnchor, onCenterAnchor);
My question is:
Why would you need both the $observe
and $watch
properties on the same items?
I've tried commenting each group out and it seems to make no difference at all. What is going on here?