what is ng-click

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

ng-click example

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

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


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.