@@ -8,35 +8,35 @@ function $TimeoutProvider() {
88 var deferreds = { } ;
99
1010
11- /**
12- * @ngdoc service
13- * @name $timeout
14- *
15- * @description
16- * AngularJS's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch
17- * block and delegates any exceptions to
18- * {@link ng.$exceptionHandler $exceptionHandler} service.
19- *
20- * The return value of calling `$timeout` is a promise, which will be resolved when
21- * the delay has passed and the timeout function, if provided, is executed.
22- *
23- * To cancel a timeout request, call `$timeout.cancel(promise)`.
24- *
25- * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to
26- * synchronously flush the queue of deferred functions.
27- *
28- * If you only want a promise that will be resolved after some specified delay
29- * then you can call `$timeout` without the `fn` function.
30- *
31- * @param {function()= } fn A function, whose execution should be delayed.
32- * @param {number= } [delay=0] Delay in milliseconds.
33- * @param {boolean= } [invokeApply=true] If set to `false` skips model dirty checking, otherwise
34- * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.
35- * @param {...*= } Pass additional parameters to the executed function.
36- * @returns {Promise } Promise that will be resolved when the timeout is reached. The promise
37- * will be resolved with the return value of the `fn` function.
38- *
39- */
11+ /**
12+ * @ngdoc service
13+ * @name $timeout
14+ *
15+ * @description
16+ * AngularJS's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch
17+ * block and delegates any exceptions to
18+ * {@link ng.$exceptionHandler $exceptionHandler} service.
19+ *
20+ * The return value of calling `$timeout` is a promise, which will be resolved when
21+ * the delay has passed and the timeout function, if provided, is executed.
22+ *
23+ * To cancel a timeout request, call `$timeout.cancel(promise)`.
24+ *
25+ * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to
26+ * synchronously flush the queue of deferred functions.
27+ *
28+ * If you only want a promise that will be resolved after some specified delay
29+ * then you can call `$timeout` without the `fn` function.
30+ *
31+ * @param {function()= } fn A function, whose execution should be delayed.
32+ * @param {number= } [delay=0] Delay in milliseconds.
33+ * @param {boolean= } [invokeApply=true] If set to `false` skips model dirty checking, otherwise
34+ * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.
35+ * @param {...*= } Pass additional parameters to the executed function.
36+ * @returns {Promise } Promise that will be resolved when the timeout is reached. The promise
37+ * will be resolved with the return value of the `fn` function.
38+ *
39+ */
4040 function timeout ( fn , delay , invokeApply ) {
4141 if ( ! isFunction ( fn ) ) {
4242 invokeApply = delay ;
@@ -70,18 +70,18 @@ function $TimeoutProvider() {
7070 }
7171
7272
73- /**
74- * @ngdoc method
75- * @name $timeout#cancel
76- *
77- * @description
78- * Cancels a task associated with the `promise`. As a result of this, the promise will be
79- * resolved with a rejection.
80- *
81- * @param {Promise= } promise Promise returned by the `$timeout` function.
82- * @returns {boolean } Returns `true` if the task hasn't executed yet and was successfully
83- * canceled.
84- */
73+ /**
74+ * @ngdoc method
75+ * @name $timeout#cancel
76+ *
77+ * @description
78+ * Cancels a task associated with the `promise`. As a result of this, the promise will be
79+ * resolved with a rejection.
80+ *
81+ * @param {Promise= } promise Promise returned by the `$timeout` function.
82+ * @returns {boolean } Returns `true` if the task hasn't executed yet and was successfully
83+ * canceled.
84+ */
8585 timeout . cancel = function ( promise ) {
8686 if ( promise && promise . $$timeoutId in deferreds ) {
8787 // Timeout cancels should not report an unhandled promise.
0 commit comments