From e2efa230153a416953eebff4b63d86fcbb28d063 Mon Sep 17 00:00:00 2001 From: Uri Goldshtein Date: Fri, 27 Sep 2013 17:28:41 +0200 Subject: docs($timeout): add a $timeout example The original example is by gxlcl. Closes #4180 --- src/ng/timeout.js | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) (limited to 'src/ng/timeout.js') diff --git a/src/ng/timeout.js b/src/ng/timeout.js index a32538ee..08086c90 100644 --- a/src/ng/timeout.js +++ b/src/ng/timeout.js @@ -31,6 +31,94 @@ function $TimeoutProvider() { * will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block. * @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