From 73c66715c9a13b0fdacf98a9e9f237063a97ebc3 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Tue, 17 Dec 2013 22:53:28 +0000 Subject: docs(bootstrap-prettify): fix $timeout issues and update related docs End 2 end tests wait for all `$timeout`s to be run before completing the test. This was problematic where we were using timeouts that restarted themselves because there would never be a point when all timeouts had completed, causing the tests to hang. To fix this $timeout had been monkey-patched but this caused other issue itself. Now that we have $interval we don't need to use $timeout handlers that re-trigger the $timeout so we can ditch the monkey-patch. This commit tidies up any examples that are using this approach and changes them to use $interval instead. Closes #5232 --- src/ng/interval.js | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/ng/timeout.js | 87 ------------------------------------------------------ 2 files changed, 82 insertions(+), 87 deletions(-) (limited to 'src') diff --git a/src/ng/interval.js b/src/ng/interval.js index 2ad3a7f1..1ae13648 100644 --- a/src/ng/interval.js +++ b/src/ng/interval.js @@ -32,6 +32,88 @@ function $IntervalProvider() { * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise * will invoke `fn` within the {@link ng.$rootScope.Scope#methods_$apply $apply} block. * @returns {promise} A promise which will be notified on each iteration. + * + * @example + + + + +
+
+ Date format:
+ Current time is: +
+ Blood 1 : {{blood_1}} + Blood 2 : {{blood_2}} + + + +
+
+ +
+
*/ function interval(fn, delay, count, invokeApply) { var setInterval = $window.setInterval, diff --git a/src/ng/timeout.js b/src/ng/timeout.js index 51e627b9..511a0a05 100644 --- a/src/ng/timeout.js +++ b/src/ng/timeout.js @@ -32,93 +32,6 @@ function $TimeoutProvider() { * @returns {Promise} Promise that will be resolved when the timeout is reached. The value this * promise will be resolved with is the return value of the `fn` function. * - * @example - - - - -
-
- Date format:
- Current time is: -
- Blood 1 : {{blood_1}} - Blood 2 : {{blood_2}} - - - -
-
- -
-
*/ function timeout(fn, delay, invokeApply) { var deferred = $q.defer(), -- cgit v1.2.3