From 162f41a1abd6ec041ff6cfead605321a554063b1 Mon Sep 17 00:00:00 2001
From: Igor Minar
Date: Wed, 24 Nov 2010 17:21:37 -0800
Subject: docs for angular.Object.size
---
src/Angular.js | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
(limited to 'src')
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() }}
+ * Number of items in object: {{ {a:1, b:2, c:3}.$size() }}
+ */
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.
--
cgit v1.2.3