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

Function $watchCollectionAction

lib/test/angular/1.7.0/angular.js:18420–18447  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18418 }
18419
18420 function $watchCollectionAction() {
18421 if (initRun) {
18422 initRun = false;
18423 listener(newValue, newValue, self);
18424 } else {
18425 listener(newValue, veryOldValue, self);
18426 }
18427
18428 // make a copy for the next time a collection is changed
18429 if (trackVeryOldValue) {
18430 if (!isObject(newValue)) {
18431 //primitive
18432 veryOldValue = newValue;
18433 } else if (isArrayLike(newValue)) {
18434 veryOldValue = new Array(newValue.length);
18435 for (var i = 0; i < newValue.length; i++) {
18436 veryOldValue[i] = newValue[i];
18437 }
18438 } else { // if object
18439 veryOldValue = {};
18440 for (var key in newValue) {
18441 if (hasOwnProperty.call(newValue, key)) {
18442 veryOldValue[key] = newValue[key];
18443 }
18444 }
18445 }
18446 }
18447 }
18448
18449 return this.$watch(changeDetector, $watchCollectionAction);
18450 },

Callers

nothing calls this directly

Calls 3

listenerFunction · 0.70
isObjectFunction · 0.70
isArrayLikeFunction · 0.70

Tested by

no test coverage detected