1 | /**
|
2 | * This is example to use "apeman-ui-contrib-angular-timing".
|
3 | */
|
4 |
|
5 | (function () {
|
6 | ;
|
7 |
|
8 | angular
|
9 | .module('my-module-01', [
|
10 | 'apeman-ui-contrib-angular-timing'
|
11 | ])
|
12 | .controller('ExampleCtrl', function ($scope,
|
13 | apSchedule) {
|
14 |
|
15 | var schedule = apSchedule.create();
|
16 |
|
17 | // Reserve a task.
|
18 | var timer01 = schedule.reserve(function () {/*...*/
|
19 | }, 1500);
|
20 |
|
21 | // Cancel a task.
|
22 | schedule.cancel(timer01);
|
23 |
|
24 | $scope.$on('$destroy', function () {
|
25 | // Cancel all undone tasks.
|
26 | schedule.cancelAll();
|
27 | });
|
28 | });
|
29 |
|
30 | })(); |
\ | No newline at end of file |