Example1
AngularJS ng-gblclick example to increment a variable on every double click.
<div ng-app="myApp" ng-controller='MyCtrl'> <button ng-dblclick="count = count + 1" ng-init="count=0">Double click to increment</button> <div>count: {{count}}</div> </div> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script> <script> var module = angular.module('myApp', []); module.controller('MyCtrl', function($scope) {}); </script>
Example2
AngularJS ng-dblclick example to increment a variable on every double click. This time use function “inc” to increment the variable.
<div ng-app="myApp" ng-controller='MyCtrl'> <button ng-dblclick="inc()" ng-init="count=0">Double click to increment</button> <div>count: {{count}}</div> </div> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js"></script> <script> var module = angular.module('myApp', []); module.controller('MyCtrl', function($scope) { $scope.inc = function() { $scope.count += 1; }; }); </script>