-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
34 lines (26 loc) · 762 Bytes
/
index.html
File metadata and controls
34 lines (26 loc) · 762 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
32
33
34
<!DOCTYPE html>
<html>
<head>
<title>angular.throttle</title>
<meta charset="utf8">
</head>
<body>
<h1>angular.throttle</h1>
<script src="bower_components/angular/angular.js"></script>
<script src="src/angular.throttle.js"></script>
<script>
(function () {
// This function will be invoked one of ten times.
setInterval(angular.throttle(function () {
console.log('Will be logged at 1 of 10 calls.');
}, 1000), 100);
// Declares a throttled function
// This function will be invoked by a minimum of 250 ms
var throttledResize = angular.throttle(function () {
console.log('No browser drain at each event please.');
}, 250);
angular.element(window).on('resize', throttledResize);
}.apply(window));
</script>
</body>
</html>