MCPcopy Index your code
hub / github.com/angular-ui/ui-grid / $watchCollectionAction

Function $watchCollectionAction

lib/test/angular/1.4.3/angular.js:15545–15572  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15543 }
15544
15545 function $watchCollectionAction() {
15546 if (initRun) {
15547 initRun = false;
15548 listener(newValue, newValue, self);
15549 } else {
15550 listener(newValue, veryOldValue, self);
15551 }
15552
15553 // make a copy for the next time a collection is changed
15554 if (trackVeryOldValue) {
15555 if (!isObject(newValue)) {
15556 //primitive
15557 veryOldValue = newValue;
15558 } else if (isArrayLike(newValue)) {
15559 veryOldValue = new Array(newValue.length);
15560 for (var i = 0; i < newValue.length; i++) {
15561 veryOldValue[i] = newValue[i];
15562 }
15563 } else { // if object
15564 veryOldValue = {};
15565 for (var key in newValue) {
15566 if (hasOwnProperty.call(newValue, key)) {
15567 veryOldValue[key] = newValue[key];
15568 }
15569 }
15570 }
15571 }
15572 }
15573
15574 return this.$watch(changeDetector, $watchCollectionAction);
15575 },

Callers

nothing calls this directly

Calls 3

listenerFunction · 0.70
isObjectFunction · 0.70
isArrayLikeFunction · 0.70

Tested by

no test coverage detected