mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
bettor function iterator
This commit is contained in:
parent
6470b48ce0
commit
8394353b85
3 changed files with 5 additions and 3693 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -2,3 +2,4 @@ angular-minified.map
|
|||
externs.js
|
||||
angular.js
|
||||
angular-minified.js
|
||||
angular-debug.js
|
||||
|
|
|
|||
3689
angular-debug.js
vendored
3689
angular-debug.js
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -36,14 +36,14 @@ function angularAlert(){
|
|||
function foreach(obj, iterator, context) {
|
||||
var key;
|
||||
if (obj) {
|
||||
if (obj.forEach) {
|
||||
obj.forEach(iterator, context);
|
||||
} else if (isFunction(obj)){
|
||||
if (isFunction(obj)){
|
||||
for (key in obj) {
|
||||
if (key != 'prototype' && key != 'length' && key != 'name') {
|
||||
if (key != 'prototype' && key != 'length' && key != 'name' && obj.hasOwnProperty(key)) {
|
||||
iterator.call(context, obj[key], key);
|
||||
}
|
||||
}
|
||||
} else if (obj.forEach) {
|
||||
obj.forEach(iterator, context);
|
||||
} else if (isObject(obj) && isNumber(obj.length)) {
|
||||
for (key = 0; key < obj.length; key++)
|
||||
iterator.call(context, obj[key], key);
|
||||
|
|
|
|||
Loading…
Reference in a new issue