diff options
| author | Alex Pods | 2013-05-06 11:41:43 +0400 | 
|---|---|---|
| committer | Pete Bacon Darwin | 2013-05-09 22:04:13 +0100 | 
| commit | 04d4c738b505574525ec30061017c1adac1ff85e (patch) | |
| tree | 6facdb24ad61ed5e32ad4c89dabc93b46ee006bb /src/Angular.js | |
| parent | 4ae4f1edd230affcf4a6675fd748f86665ce2f8b (diff) | |
| download | angular.js-04d4c738b505574525ec30061017c1adac1ff85e.tar.bz2 | |
docs(Angular.js) move forEach docs to correct place
Diffstat (limited to 'src/Angular.js')
| -rw-r--r-- | src/Angular.js | 45 | 
1 files changed, 21 insertions, 24 deletions
diff --git a/src/Angular.js b/src/Angular.js index 45023d6c..d56b154b 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -82,6 +82,27 @@ function noConflict() {  }  /** + * @private + * @param {*} obj + * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...) + */ +function isArrayLike(obj) { +  if (!obj || (typeof obj.length !== 'number')) return false; + +  // We have on object which has length property. Should we treat it as array? +  if (typeof obj.hasOwnProperty != 'function' && +      typeof obj.constructor != 'function') { +    // This is here for IE8: it is a bogus object treat it as array; +    return true; +  } else  { +    return obj instanceof JQLite ||                      // JQLite +           (jQuery && obj instanceof jQuery) ||          // jQuery +           toString.call(obj) !== '[object Object]' ||   // some browser native object +           typeof obj.callee === 'function';              // arguments (on IE8 looks like regular obj) +  } +} + +/**   * @ngdoc function   * @name angular.forEach   * @function @@ -108,30 +129,6 @@ function noConflict() {   * @param {Object=} context Object to become context (`this`) for the iterator function.   * @returns {Object|Array} Reference to `obj`.   */ - - -/** - * @private - * @param {*} obj - * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments, ...) - */ -function isArrayLike(obj) { -  if (!obj || (typeof obj.length !== 'number')) return false; - -  // We have on object which has length property. Should we treat it as array? -  if (typeof obj.hasOwnProperty != 'function' && -      typeof obj.constructor != 'function') { -    // This is here for IE8: it is a bogus object treat it as array; -    return true; -  } else  { -    return obj instanceof JQLite ||                      // JQLite -           (jQuery && obj instanceof jQuery) ||          // jQuery -           toString.call(obj) !== '[object Object]' ||   // some browser native object -           typeof obj.callee === 'function';              // arguments (on IE8 looks like regular obj) -  } -} - -  function forEach(obj, iterator, context) {    var key;    if (obj) {  | 
