AngularJs ng-click event example


AngularJs ng-click event example : AngularJs ng-click binds click event with elements in html.


Syntax : AngularJs ng-click event

The below example shows the ng-click event directive.

Example

<!DOCTYPE html>
<html lang="en">
<head>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js"></script>
</head>

<body>
<div ng-app="" ng-init="i=1">
    <button ng-click="i = i+1">Click Me</button>
     Counter = {{i}}
</div>
</body>
</html>

Try it »

AngularJs ng-click event example

AngularJs ng-click event example


Advertisements

Add Comment

📖 Read More