forked from angular/code.angularjs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathangular.Object.size.html
25 lines (24 loc) · 1.12 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
21
22
23
24
25
<h1>angular.Object.size</h1>
<div class="angular-object-size"><h2>Description</h2>
<div class="description"><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></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.Object.size(obj);</pre>
</div>
<h3>Parameters</h3>
<ul class="parameters"><li><code ng:non-bindable="">obj – {Object|Array} – </code>
<p>Object or array to inspect.</p></li>
</ul>
<h3>Returns</h3>
<div class="returns"><code ng:non-bindable="">{number}</code>
– <p>The size of <code>obj</code> or <code>0</code> if <code>obj</code> is neither an object or an array.</p></div>
</div>
<h2>Example</h2>
<div class="example"><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>
</div>
</div>