You can use a combination of onmouseenterand onmouseleave: if the mouse enters the element and does not go away for at least 2 seconds, then rate it.
<div debounce-mouseover="getData()" stay-at-least="2"></div>
And the directive debounceMouseover:
template: "<div ng-mouseenter="onEnter()" ng-mouseleave="onLeave()">",
link: function(scope, elem, attrs) {
var stayAtLeast = attrs.stayAtLeast;
var timer;
scope.onEnter = function() {
timer = $timeout(function() {
scope.$eval(attrs.debounceMouseover);
}, stayAtLeast);
};
scope.onLeave = function() {
$timeout.cancel(timer);
};
}
( , , , )