MCPcopy Index your code
hub / github.com/angular-ui/ui-router / recordChanges

Function recordChanges

test/angular/1.7/angular.js:11416–11435  ·  view source on GitHub ↗
(key, currentValue, previousValue)

Source from the content-addressed store, hash-verified

11414 });
11415
11416 function recordChanges(key, currentValue, previousValue) {
11417 if (isFunction(destination.$onChanges) && !simpleCompare(currentValue, previousValue)) {
11418 // If we have not already scheduled the top level onChangesQueue handler then do so now
11419 if (!onChangesQueue) {
11420 scope.$$postDigest(flushOnChangesQueue);
11421 onChangesQueue = [];
11422 }
11423 // If we have not already queued a trigger of onChanges for this controller then do so now
11424 if (!changes) {
11425 changes = {};
11426 onChangesQueue.push(triggerOnChangesHook);
11427 }
11428 // If the has been a change on this property already then we need to reuse the previous value
11429 if (changes[key]) {
11430 previousValue = changes[key].previousValue;
11431 }
11432 // Store this change
11433 changes[key] = new SimpleChange(previousValue, currentValue);
11434 }
11435 }
11436
11437 function triggerOnChangesHook() {
11438 destination.$onChanges(changes);

Callers 1

Calls 2

isFunctionFunction · 0.70
simpleCompareFunction · 0.70

Tested by

no test coverage detected