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

Function $watchCollectionAction

lib/test/angular/1.6.7/angular.js:18216–18243  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18214 }
18215
18216 function $watchCollectionAction() {
18217 if (initRun) {
18218 initRun = false;
18219 listener(newValue, newValue, self);
18220 } else {
18221 listener(newValue, veryOldValue, self);
18222 }
18223
18224 // make a copy for the next time a collection is changed
18225 if (trackVeryOldValue) {
18226 if (!isObject(newValue)) {
18227 //primitive
18228 veryOldValue = newValue;
18229 } else if (isArrayLike(newValue)) {
18230 veryOldValue = new Array(newValue.length);
18231 for (var i = 0; i < newValue.length; i++) {
18232 veryOldValue[i] = newValue[i];
18233 }
18234 } else { // if object
18235 veryOldValue = {};
18236 for (var key in newValue) {
18237 if (hasOwnProperty.call(newValue, key)) {
18238 veryOldValue[key] = newValue[key];
18239 }
18240 }
18241 }
18242 }
18243 }
18244
18245 return this.$watch(changeDetector, $watchCollectionAction);
18246 },

Callers

nothing calls this directly

Calls 3

listenerFunction · 0.70
isObjectFunction · 0.70
isArrayLikeFunction · 0.70

Tested by

no test coverage detected