The beast's Ng API learns--Ngkeydown/ngkeypress/ngkeyup and ngmousedown/ngmouseenter/ngmouseleave/ngmousemove/ngmouseover/ Ngmouseup
Ngkeydown/ngkeypress/ngkeyup
The instruction executes the specified expression when the key press/Key Press/Key is released.
Ngkeydown and ngkeypress slightly different, the current test is ngkeypress for the system button is not valid, and Ngkeydown can.
The Ngkeyup command executes when the key is released.
Using code:
<input ng-keydown="Count = Count + 1" ng-init="count=0"> {{count}}
<input ng-keypress="Count = Count + 1" ng-init="count=0">{{count}}
<input Ng-keyup="Count = Count + 1" ng-init="count=0">{{count}}
Ngmousedown/ngmouseenter/ngmouseleave/ngmousemove/ngmouseover/ngmouseup
The instruction executes the specified expression when the mouse is pressed/the mouse enters/the mouse is left/the mouse moves/the mouse is on the top/mouse is released.
Using code:
<button ng-mousedown="Count = Count + 1" ng-init="count=0"> on mouse</button>{{count}}
<button ng-mouseenter= "Count = Count + 1" ng-init = "count=0" >when mouse enter< span class= "tag" ></button>{{count}}
< Span class= "PLN" >< span class= "tag" ><button ng-mouseleave = "Count = Count + 1" ng-init= "count=0" >when mouse leave </button>{{count}}
<button ng-mousemove= "Count = count + 1" Span class= "PLN" > ng-init= "count=0" >when mouse move</button> {{count}
<button ng-mouseover= "Count = Count + 1" < Span class= "ATN" >ng-init= "count=0" >when mouse is over</button>{{count}}
<button ng-mouseup= "Count = Count + 1" ng-init= "count=0" >on mouse Up</button>{{count}}
I didn't want to write these instructions, after all, it was a little bit simpler ... then think back, maybe sometimes the project needs to be used, or the use of these instructions is summed up ....
Beast's angular Api learning, translating and understanding-keyboard events and mouse events