aboutsummaryrefslogtreecommitdiffstats
path: root/src/Angular.js
diff options
context:
space:
mode:
authorMisko Hevery2010-04-16 14:01:29 -0700
committerMisko Hevery2010-04-16 14:01:29 -0700
commitdeb86fe357a901889bc4289087f0b9e69cb8a302 (patch)
treefce4db8501a6c24430d611c95a4aa001119c7b89 /src/Angular.js
parent70e401ef100614295fc808e32f0142f07c315461 (diff)
downloadangular.js-deb86fe357a901889bc4289087f0b9e69cb8a302.tar.bz2
lots of small fixes
Diffstat (limited to 'src/Angular.js')
-rw-r--r--src/Angular.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 88aab8e7..87a2f3d6 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -38,6 +38,12 @@ function foreach(obj, iterator, context) {
if (obj) {
if (obj.forEach) {
obj.forEach(iterator, context);
+ } else if (isFunction(obj)){
+ for (key in obj) {
+ if (key != 'prototype' && key != 'length' && key != 'name') {
+ iterator.call(context, obj[key], key);
+ }
+ }
} else if (isObject(obj) && isNumber(obj.length)) {
for (key = 0; key < obj.length; key++)
iterator.call(context, obj[key], key);
@@ -113,7 +119,7 @@ function isElement(node) {
function isVisible(element) {
var rect = element[0].getBoundingClientRect();
- return rect.width !=0 && rect.height !=0;
+ return rect.width && rect.height;
}
function map(obj, iterator, context) {