forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.scope.$onEval.html
31 lines (30 loc) · 1.52 KB
/
angular.scope.$onEval.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.scope.$onEval</h1>
<div class="angular-scope-oneval"><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>Evaluates the <code>expr</code> expression in the context of the current scope during each
<a href="#!angular.scope.$eval"><code>eval cycle</code></a>.</p>
<h3>Example</h3><div ng:non-bindable><pre class="brush: js; html-script: true;">
var scope = angular.scope();
scope.counter = 0;
scope.$onEval('counter = counter + 1');
expect(scope.counter).toEqual(0);
scope.$eval();
expect(scope.counter).toEqual(1);
</pre></div></div>
<h2>Dependencies</h2>
<ul class="dependencies"></ul>
<h2>Usage</h2>
<div class="usage"><div ng:non-bindable=""><pre class="brush: js; html-script: true;">angular.scope.$onEval(priority, expr[, exceptionHandler]);</pre>
</div>
<h3>Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">priority – {number} – </code>
<p>Execution priority. Lower priority numbers get executed first.</p></li>
<li><code ng:non-bindable="">expr – {string|function()} – </code>
<p>Angular expression or function to be executed.</p></li>
<li><code ng:non-bindable="">exceptionHandler<i>(optional=angular.service.$exceptionHandler)</i> – {(function()|DOMElement)} – </code>
<p>Handler
function to call or DOM element to decorate when an exception occurs.</p></li>
</ul>
</div>
</div>