forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.Object.size.html
20 lines (19 loc) · 1.06 KB
/
angular.Object.size.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<h1>angular.Object.size</h1>
<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>
<p>Determines the number of elements in an array or number of properties of an object.</p>
<p>Note: this function is used to augment the Object type in angular expressions. See
<a href="#!angular.Object"><code>angular.Object</code></a> for more info.</p><h2>Usage</h2>
<div ng:non-bindable=""><pre class="brush: js; html-script: true;">angular.Object.size(obj);</pre>
</div>
<h3>Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">obj – {Object|Array} – </code>
Object or array to inspect.</li>
</ul>
<h3>Returns</h3>
<code ng:non-bindable="">number</code>
– The size of <code>obj</code> or <code>0</code> if <code>obj</code> is not an object or array.<h2>Example</h2>
<doc:example><doc:source>Number of items in array: {{ [1,2].$size() }}<br/>
Number of items in object: {{ {a:1, b:2, c:3}.$size() }}<br/></doc:source>
</doc:example>