AngularJS ng-mousemove directive

Definition and Usage

ng-mousemove tells AngularJS what operation to perform when the mouse cursor moves over a specific HTML element.

The directive of AngularJS ng-mousemove The directive does not override the original onmousemove event of the element, both will be executed.

Example

Execute the expression when the mouse cursor moves over the <div> element:

<div ng-mousemove="count = count + 1" ng-init="count=0">Mouse over me!</div>
<h1>{{count}}</h1>

Try It Yourself

Syntax

<element ng-mousemove="expression</element>

All HTML elements support it.

Parameters

Parameters Description
expression An expression to be executed when the mouse cursor moves over an element.