Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

AngularJS ng-mouseleave Directive

AngularJS ng-mouseleave Instruction

AngularJS Reference Manual AngularJS Reference Manual


AngularJS Examples

Execute an expression when the mouse pointer leaves an element:

<

div

ng-mouseleave=

"count = count + 1"

ng-init=

"count=0"

Move your mouse away from me!

<

/div

<

h1

{{count}}

<

/h1

Try it »


Definition and Usage

ng-mouseleave The directive tells AngularJS the action to take when the mouse is moved away from an HTML element.

ng-mouseleave The directive does not override the element's native onmouseleave event. When the event is triggered,ng-mouseleave both the expression and the native onmouseleave event will be executed.


Syntax

<

element

ng-mouseleave=

"expression"

<

/element

All HTML elements support this directive.


Parameter value

Value Description
expression The expression to execute when the mouse is moved away from the element.

AngularJS Reference Manual AngularJS Reference Manual