Runoob Tutorial ArchiveEnglish

AngularJS ng-mouseup directive

AngularJSng-mouseupDirective

AngularJS Reference ManualAngularJS Reference Manual


AngularJS Example

Expression executed when mouse button is released on an element:

<

div

ng-mouseup=

"count = count + 1"

ng-init=

"count=0"

Click me!

<

/div

<

h1

{{count}}

<

/h1

Try it »


Definition and Usage

ng-mouseupDirective used to tell AngularJS what to do when the mouse button is released on a specified HTML element (click complete).

ng-mouseupThe directive will not override the element's native onmouseup event; when the event is triggered,ng-mouseupBoth the expression and the native onmouseup event will execute.

Mouse click execution order:

  1. Mousedown
  2. Mouseup
  3. Click

Syntax

<

element

ng-mouseup=

"expression"

<

/element

All HTML elements support this directive.


Parameter value

Value Description
expression Expression executed when the mouse click is released.

AngularJS Reference ManualAngularJS Reference Manual