(key, currentValue, previousValue)
| 11479 | }); |
| 11480 | |
| 11481 | function recordChanges(key, currentValue, previousValue) { |
| 11482 | if (isFunction(destination.$onChanges) && !simpleCompare(currentValue, previousValue)) { |
| 11483 | // If we have not already scheduled the top level onChangesQueue handler then do so now |
| 11484 | if (!onChangesQueue) { |
| 11485 | scope.$$postDigest(flushOnChangesQueue); |
| 11486 | onChangesQueue = []; |
| 11487 | } |
| 11488 | // If we have not already queued a trigger of onChanges for this controller then do so now |
| 11489 | if (!changes) { |
| 11490 | changes = {}; |
| 11491 | onChangesQueue.push(triggerOnChangesHook); |
| 11492 | } |
| 11493 | // If the has been a change on this property already then we need to reuse the previous value |
| 11494 | if (changes[key]) { |
| 11495 | previousValue = changes[key].previousValue; |
| 11496 | } |
| 11497 | // Store this change |
| 11498 | changes[key] = new SimpleChange(previousValue, currentValue); |
| 11499 | } |
| 11500 | } |
| 11501 | |
| 11502 | function triggerOnChangesHook() { |
| 11503 | destination.$onChanges(changes); |
no test coverage detected