This article mainly introduces the angularjs ng-dblclick instruction.Here is a summary and detailed introduction of the basic data of ng-dblclickSimple code examples and implementation effects,Hope to help friends learning angularjs

angularjs ng-dblclick directive

angularjs example

Every time you double-click,Variable count plus 1:

<! Doctype html>
<meta charset="utf-8">
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
<body ng-app="">
<p>Double-click on the title:</p>
<h1 ng-dblclick="count=count + 1" ng-init="count=0">welcome</h1>
<p>{{count}} double-clicks.</p>
<p>The count variable "count" is incremented by one each time you double-click the title with the mouse.</p>

note:The count variable "count" is incremented by 1 after each double-click on the title.

Definition and usage

The ng-dblclick directive is used to tell angularjs what to do when the mouse is over the html element.

The ng-dblclick instruction does not overwrite the element's original ondblclick event.Both the ng-dblclick expression and the original ondblclick event will be executed.


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

All html elements support this directive.

Parameter value

value description
expression An expression that is executed when the mouse is double-clicked on an element.

  • Previous Threejs learning geometry
  • Next C # Windows API application based on FlashWindowEx method to achieve window flicker