Skip to content
Related Articles

Related Articles

What is the use of a double-click event in AngularJs?

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 25 Jul, 2019

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.


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

Parameter Values:

  • expression: The execution of the expression, when double-click is done on any element.
  • 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>
    <script src=
            AngularJS ng-dblclick Directive
    <body style="text-align:center;" ng-app="">
        <h1 style="color:green">
        <h2 style="color:purple">
          ng-dblclick Directive
        <p>On the header given below, 
          Double-Click on it.</p>
        <h1 style="color:#EA6964" 
            ng-dblclick="count = count + 1"
        <p>Double-Click has been done {{count}} times.</p>


    My Personal Notes arrow_drop_up
    Recommended Articles
    Page :

    Start Your Coding Journey Now!