what is ng-click

Ng-click directive provides the custom behaviour when an element is clicked. When elements clicked, it will call the event handler function, which bind to ng-click.

Example of ng-click

In the following example, we perfume the sum of two numbers on button click event.

<!DOCTYPE html>
<script src="angular.js"></script>
    var x=angular.module('abc',[]).controller('abc1',function($scope){
<body ng-app='abc'>
    <div ng-controller='abc1'>
 enter 1st value:   <input type="text" ng-model='n1'><br>
 enter 2nd value:   <input type="text" ng-model='n2'><br>
 <input type="button" value="sum" ng-click='add(n1,n2)'>
        </div>    </div>


It will show the following output:-

		what is ng-click
		Figure 1

Similarly, we can also use ng-dblclick directives and it will perfume it but on double click.