AngularJS ng-mouseenter directive
AngularJS instance
Execute the expression when the mouse pointer passes through an element:
<!DOCTYPE html><html><head><meta charset="utf-8"><script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script></head><body ng-app=""><div ng-mouseenter="count = count + 1" ng-init="count=0">Mouse passes through me!</div><h1>{{count}}</h1><p>This instance will automatically add 1 to the calculation variable "count" when the mouse passes through the DIV element. </p></body></html>Definition and usage
The ng-mouseenter directive tells the AngularJS mouse what to do when an HTML element passes through.
The ng-mouseenter directive will not overwrite the element's native onmouseenter event. When the event is triggered, both the ng-mouseenter expression and the native onmouseenter event will be executed.
grammar
<element ng-mouseenter="expression"></element>
All HTML elements support this directive.
Parameter value
| value | describe |
|---|---|
| Expression | The expression executed when the mouse passes through an element. |
The above is the basic information sorting out the AngularJS ng-mouseenter directive, and the relevant information will be added in the future.