forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.service.$defer.html
31 lines (30 loc) · 1.45 KB
/
angular.service.$defer.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
<h1>angular.service.$defer</h1>
<div class="angular-service-defer"><fieldset class="workInProgress"><legend>Work in Progress</legend>
This page is currently being revised. It might be incomplete or contain inaccuracies.</fieldset>
<h2>Description</h2>
<div class="description"><p>Delegates to <a href="#!angular.service.$browser.defer"><code>$browser.defer</code></a>, but wraps the <code>fn</code> function
into a try/catch block and delegates any exceptions to
<a href="#!angular.services.$exceptionHandler"><code>$exceptionHandler</code></a> service.</p>
<p>In tests you can use <code>$browser.defer.flush()</code> to flush the queue of deferred functions.</p></div>
<h2>Dependencies</h2>
<ul class="dependencies"><li><code ng:non-bindable=""><a href="#!angular.service.$browser">$browser</a>
</code>
</li>
<li><code ng:non-bindable=""><a href="#!angular.service.$exceptionHandler">$exceptionHandler</a>
</code>
</li>
<li><code ng:non-bindable=""><a href="#!angular.service.$updateView">$updateView</a>
</code>
</li>
</ul>
<h2>Usage</h2>
<div class="usage"><div ng:non-bindable=""><pre class="brush: js; html-script: true;">$defer(fn[, delay]);</pre>
</div>
<h3>Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">fn – {function()} – </code>
<p>A function, who's execution should be deferred.</p></li>
<li><code ng:non-bindable="">delay<i>(optional=0)</i> – {number} – </code>
<p>of milliseconds to defer the function execution.</p></li>
</ul>
</div>
</div>