Tuesday, January 30, 2018

How to write a program for mouse click in angularJS.

 when a mouse button is clicked on an element, in this order:
  1. ng-mousedown
  2. ng-mouseup
  3. ng-click
Program
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
</head>
<body>
<div ng-app="ABC" ng-controller="DEF">
<button ng-click="count=count+1">
Click Me
</button>
<p>
{{count}}
</p>
</div>
<script>
var app=angular.module("ABC",[]);
app.controller("DEF", function($scope)
{
$scope.count=0;
});
</script>
</body>
</html>

Output



0 comments:

Post a Comment

Thanks For Commented.

TechTalk