-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
49 lines (47 loc) · 1.3 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>az-promise-show</title>
<style>.ng-cloak{display:none}</style>
</head>
<body ng-app="myApp">
<div ng-controller="MainCtrl as vm" class="ng-cloak">
<div>
<div>
<strong>Show Example</strong>
</div>
<button ng-click="vm.theFirstRun()">Run 1</button>
<div az-promise-show="vm.theFirstPromise">
I show when the promise is in flight
</div>
</div>
<div>
<div>
<strong>Hide Example</strong>
</div>
<button ng-click="vm.theSecondRun()">Run 2</button>
<div az-promise-hide="vm.theSecondPromise">
I show when the promise is resolved or not set
</div>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.js"></script>
<script src="//rawgit.com/alianza-dev/az-promise-show/master/dist/az-promise-show.js"></script>
<script>
angular
.module('myApp', ['azPromiseShow'])
.controller('MainCtrl', function MainCtrl($timeout) {
var vm = this;
vm.theFirstRun = theFirstRun;
vm.theSecondRun = theSecondRun;
function theFirstRun() {
vm.theFirstPromise = $timeout(angular.noop, 1500);
}
function theSecondRun() {
vm.theSecondPromise = $timeout(angular.noop, 1500);
}
});
</script>
</body>
</html>