forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.noop.html
19 lines (19 loc) · 968 Bytes
/
angular.noop.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<a href="http://github.com/angular/angular.js/tree/v1.2.3/src/Angular.js#L345" class="view-source btn btn-action"><i class="icon-zoom-in"> </i> View source</a><a href="http://github.com/angular/angular.js/edit/master/src/Angular.js" class="improve-docs btn btn-primary"><i class="icon-edit"> </i> Improve this doc</a><h1><code ng:non-bindable="">angular.noop</code>
<div><span class="hint">API in module <code ng:non-bindable="">ng</code>
</span>
</div>
</h1>
<div><h2 id="description">Description</h2>
<div class="description"><div class="angular-noop-page"><p>A function that performs no operations. This function can be useful when writing code in the
functional style.
<pre class="prettyprint linenums">
function foo(callback) {
var result = calculateResult();
(callback || angular.noop)(result);
}
</pre>
</div></div>
<h2 id="usage">Usage</h2>
<div class="usage"><pre class="prettyprint linenums">angular.noop();</pre>
</div>
</div>