AngularJS Basic ng dblclick Directive Usage
- 2021-07-06 10:09:02
- OfStack
AngularJS ng-dblclick Directive
AngularJS instance
With each double mouse click, the variable count is added by 1:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body ng-app="">
<p> Double-click the title with the mouse :</p>
<h1 ng-dblclick="count = count + 1" ng-init="count=0">Welcome</h1>
<p> Double-clicked {{count}} Times. </p>
<p> Counting variable "count" After each double-click of the title, add 1 . </p>
</body>
</html>
Note: The count variable "count" is added with 1 after each double-click of the mouse.
Definition and usage
The ng-dblclick instructions are used to tell AngularJS what to do when the mouse mouse the HTML element.
The ng-dblclick instruction does not override the element's original ondblclick event, and both the ng-dblclick expression and the original ondblclick event are executed when the mouse is double-clicked.
Grammar
<
element ng-dblclick="expression"
>
<
/element
>
All HTML elements support this instruction.
Parameter value
值 | 描述 |
---|---|
expression | 鼠标双击元素后执行的表达式。 |
The above is the data collation of ng-dblclick instruction, and continue to collate relevant data in the future. Thank you for your support!