-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathExample-of-Events.html
More file actions
26 lines (26 loc) · 895 Bytes
/
Example-of-Events.html
File metadata and controls
26 lines (26 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!doctype html>
<html ng-app="EvtMod">
<head>
<title>Example to use Events in AngularJS</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script>
<script type="text/javascript">
var EvtMod = angular.module('EvtMod', []);
EvtMod.controller('EvtCtrl', function ($scope) {
$scope.singleClick = function() {
alert('This is a single click event.');
};
$scope.doubleClick = function() {
alert('This is a double click.');
};
});
</script>
</head>
<body ng-controller="EvtCtrl">
<div style="float:left;"><h2>Events in AngularJS</h2></div>
<div style="float:right;"><img src="../images/infosys.gif" alt="Infosys" title="Infosys" style="width:420px;" /></div>
<div style="clear:both;"></div>
<hr />
<button ng-click="singleClick()">On Click</button><br /><br />
<button ng-dblclick="doubleClick()">Double Click</button>
</body>
</html>