AngularJS ng-mouseenter directive

Definition and Usage

ng-mouseenter tells AngularJS what operation to perform when the mouse cursor enters a specific HTML element.

The directive in AngularJS ng-mouseenter The directive does not override the original onmouseenter event of the element, both of which will be executed.

Example

An expression is executed when the mouse cursor enters the <div> element:

<div ng-mouseenter="count = count + 1" ng-init="count=0">Please hover your mouse over me!</div>
<h1>{{count}}</h1>

Try It Yourself

Syntax

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

All HTML elements support it.

Parameters

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