The ng-dblclick event in the AngularJS is useful for the HTML elements for getting the double click event, defined. In case a user wishes to get the function fired or other events when the double click of the HTML elements is done, then this event will be going to be needed. All the elements of the HTML will be going to support it.
Basically, the directive of ng-dblclick will be telling the AngularJS what exactly the HTML or the HTML elements need to do when it is double-clicked. However, it is not going to be overriding the original ondblclick event of the element, as both of them are going to be executed.
Syntax:
<element ng-dblclick="expression"> </element>
Parameter Values:
Example: (The example is going to increase the value of the “count” of the variable, every time a double-click is done on the header.)
<!DOCTYPE html> <html> <script src= </script> <head> <title> AngularJS ng-dblclick Directive </title> </head> <body style="text-align:center;" ng-app=""> <h1 style="color:green"> GeeksForGeeks </h1> <h2 style="color:purple"> ng-dblclick Directive </h2> <p>On the header given below, Double-Click on it.</p> <h1 style="color:#EA6964" ng-dblclick="count = count + 1" ng-init="count=0">Click</h1> <p>Double-Click has been done {{count}} times.</p> <p></p> </body> </html> |
Output:

Recommended Posts:
- AngularJS | How to use ng-idle?
- How to use filter within controllers in AngularJS ?
- Why do we use $rootScope.$broadcast in AngularJS?
- How to use AngularJS to Display HTML content value ?
- How to use *ngIf else in AngularJS ?
- How to use modal closing event in Twitter Bootstrap ?
- AngularJS | ng-show Directive
- Difference between Bootstrap and AngularJS
- AngularJS | currency Filter
- Introduction to AngularJS
- AngularJS | Factory Method
- AngularJS | ng-init Directive
- AngularJS | ng-if Directive
- AngularJS | ng-dblclick Directive
- AngularJS | ng-keypress Directive
- AngularJS | ng-keydown Directive
- AngularJS | ng-keyup Directive
- AngularJS | ng-href Directive
- AngularJS | ng-focus Directive
- AngularJS | ng-hide Directive
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

