Is it possible to use ng-mousemove
within a custom directive to watch for a mousemove
event on the element? How can I make sure that the function passed to ng-mousemove
refers to a method on my custom directive's scope? For instance:
HTML
<div my-directive ng-mousemove="go()"></div>
Custom directive:
...
scope: true,
link: function(){
$scope.go = function () { ... };
}
I understand that I could create an event listener within the directive to monitor the mousemove
event, but it seems like this may not be in line with Angular's usual practices.