angular.Object.size

Work In Progress This page is currently being revised. It might be incomplete or contain inaccuracies.

Description

Determines the number of elements in an array or number of properties of an object.

Note: this function is used to augment the Object type in angular expressions. See angular.Object for more info.

Usage

angular.Object.size(obj);

Parameters

Returns

{number} The size of obj or 0 if obj is not an object or array.

Example

Number of items in array: {{ [1,2].$size() }}<br/> Number of items in object: {{ {a:1, b:2, c:3}.$size() }}<br/>