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:

  1. Mousedown (mouse pressed)
  2. Mouseup (mouse released)
  3. 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>

Try it yourself

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.