-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
25 lines (23 loc) · 794 Bytes
/
index.html
File metadata and controls
25 lines (23 loc) · 794 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
<html ng-app="keypress-demo">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
<script src="keypress.js"></script>
</head>
<body>
<div ng-controller="KeypressController">
<input type="text" size=40 value="Hit enter or backspace here" keypress="13:enterPressed(), 8 || 46 : backSpacePressed()">
<li x-ng-repeat="key in keys track by $index">{{key}}</li>
</div>
<script type="text/javascript">
angular.module('keypress-demo',['keypress']).controller('KeypressController',function($scope){
$scope.keys=new Array();
$scope.enterPressed=function() {
$scope.keys.push("Enter");
};
$scope.backSpacePressed=function() {
$scope.keys.push("Backspace");
};
});
</script>
</body>
</html>