diff options
| author | Igor Minar | 2010-11-24 17:21:37 -0800 | 
|---|---|---|
| committer | Igor Minar | 2010-11-24 17:21:37 -0800 | 
| commit | 162f41a1abd6ec041ff6cfead605321a554063b1 (patch) | |
| tree | 5dee87c841753c760d74dfe091173a673cca727d /src | |
| parent | 7c82c4f83756b8b62231b46f864fb1107db0f989 (diff) | |
| download | angular.js-162f41a1abd6ec041ff6cfead605321a554063b1.tar.bz2 | |
docs for angular.Object.size
Diffstat (limited to 'src')
| -rw-r--r-- | src/Angular.js | 24 | 
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Angular.js b/src/Angular.js index 7d6f8502..311be0ca 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -675,6 +675,27 @@ function map(obj, iterator, context) {    });    return results;  } + + +/** + * @workInProgress + * @ngdoc function + * @name angular.Object.size + * @function + * + * @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 + * {@link angular.Object} for more info. + * + * @param {Object|Array} obj Object or array to inspect. + * @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/> + */  function size(obj) {    var size = 0;    if (obj) { @@ -778,6 +799,9 @@ function copy(source, destination){   * For objects `function` properties and properties that start with `$` are not considered during   * comparisons.   * + * Note: this function is used to augment the Object type in angular expressions. See + * {@link angular.Object} for more info. + *   * @param {*} o1 Object or value to compare.   * @param {*} o2 Object or value to compare.   * @returns {boolean} True if arguments are equal.  | 
