AngularJS ng-mousedown-instructie
Definitie en gebruik
ng-mousedown
Het commando vertelt AngularJS wat te doen wanneer er op de muisknop wordt geklikt op een specifiek HTML-element.
AngularJS' ng-mousedown
Directives do not override the original onmousedown event of the element, both will be executed.
De volgorde van de muisklik is:
- Mousedown (mouse pressed)
- Mouseup (mouse released)
- Click (click)
Example
Uitdrukking die wordt uitgevoerd bij een muisklik:
<div ng-mousedown="count = count + 1" ng-init="count=0">Click me!</div> <h1>{{count}}</h1>
Syntax
<element ng-mousedown="expression</element>
All HTML elements support this.
Parameters
Parameters | Description |
---|---|
expression | Uitdrukking die moet worden uitgevoerd wanneer de muisknop wordt ingedrukt. |