AngularJS ng-mouseupDirectives

AngularJS 参考手册AngularJS Reference Manual


AngularJS Example

Execute an expression when the mouse button is released on the element:

<div ng-mouseup="count = count + 1" ng-init="count=0">Click me!</div>

<h1>{{count}}</h1>

Try it Yourself »

Definition and Usage

ng-mouseupThe directive tells AngularJS what to do when the mouse button is released on the specified HTML element (when a click is completed).

ng-mouseupThe directive does not override the element's native onmouseup event. When the event is triggered,ng-mouseupboth the expression and the native onmouseup event will be executed.

Order of mouse click execution:

  1. Mousedown
  2. Mouseup
  3. Click

Syntax

<element ng-mouseup="expression"></element>

All HTML elements support this directive.


Parameter Value

Value Description
expression The expression executed when the mouse button is released at the completion of a mouse click.

AngularJS 参考手册AngularJS Reference Manual

Other Extensions