(key, currentValue, previousValue)
| 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); |
no test coverage detected