-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
28 lines (28 loc) · 1.41 KB
/
index.html
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
27
28
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>My AngularJS App</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" />
</head>
<body style="width: 100%; height: 1000px; padding-top: 50px;" ng-controller="myCtrl" global-click-trigger>
<div>
<div style="margin-left: auto; margin-right: auto; width: 400px; height: 300px; border: 1px solid #ccc" on-global-click="count = count + 1">
<p>This box is registered with <code>on-global-click="count = count + 1"</code>, which means when not clicking on this element, the code will be executed.</p>
<p>Please click outside of the box (body tag), where <code>global-click-trigger</code> registered!</p>
<p>You clicked outside {{count}} times!</p>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js"></script>
<script src="src/ng-global-click.js"></script>
<script>
angular.module('myApp', ['ngGlobalClick'])
.controller('myCtrl', function ($scope) {
$scope.count = 0;
});
</script>
</body>
</html>