AngularJS ng-mouseleaveDirective
AngularJS Example
Execute an expression when the mouse pointer leaves the element:
<div ng-mouseleave="count = count + 1" ng-init="count=0">Mouse moves away from me
me!</div>
<h1>{{count}}</h1>
<h1>{{count}}</h1>
Try it Yourself »
Definition and Usage
ng-mouseleaveThe directive is used to tell AngularJS what action to perform when the mouse moves away from an HTML element.
ng-mouseleaveThe directive does not override the element's native onmouseleave event. When the event is triggered,ng-mouseleaveboth the expression and the native onmouseleave event will be executed.
Syntax
<element ng-mouseleave="expression"></element>
All HTML elements support this directive.
Parameter Values
| Value | Description |
|---|---|
| expression | The expression to be executed when the mouse leaves the element. |
Other Extensions
AngularJS Reference Manual