forked from Apress/pro-angularjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListing 05.html
More file actions
31 lines (31 loc) · 999 Bytes
/
Listing 05.html
File metadata and controls
31 lines (31 loc) · 999 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
27
28
29
30
31
<!DOCTYPE html>
<html ng-app="exampleApp">
<head>
<title>Swipe Events</title>
<script src="angular.js"></script>
<script src="angular-touch.js"></script>
<link href="bootstrap.css" rel="stylesheet" />
<link href="bootstrap-theme.css" rel="stylesheet" />
<script>
angular.module("exampleApp", ["ngTouch"])
.controller("defaultCtrl", function ($scope, $element) {
$scope.swipeType = "<None>";
$scope.handleSwipe = function(direction) {
$scope.swipeType = direction;
}
});
</script>
</head>
<body ng-controller="defaultCtrl">
<div class="panel panel-default">
<div class="panel-body">
<div class="well"
ng-swipe-right="handleSwipe('left-to-right')"
ng-swipe-left="handleSwipe('right-to-left')">
<h4>Swipe Here</h4>
</div>
<div>Swipe was: {{swipeType}}</div>
</div>
</div>
</body>
</html>