mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-20 08:20:25 +00:00
docs for angular.Object.size
This commit is contained in:
parent
7c82c4f837
commit
162f41a1ab
1 changed files with 24 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue