(key, currentValue, previousValue)
| 10756 | }); |
| 10757 | |
| 10758 | function recordChanges(key, currentValue, previousValue) { |
| 10759 | if (isFunction(destination.$onChanges) && !simpleCompare(currentValue, previousValue)) { |
| 10760 | // If we have not already scheduled the top level onChangesQueue handler then do so now |
| 10761 | if (!onChangesQueue) { |
| 10762 | scope.$$postDigest(flushOnChangesQueue); |
| 10763 | onChangesQueue = []; |
| 10764 | } |
| 10765 | // If we have not already queued a trigger of onChanges for this controller then do so now |
| 10766 | if (!changes) { |
| 10767 | changes = {}; |
| 10768 | onChangesQueue.push(triggerOnChangesHook); |
| 10769 | } |
| 10770 | // If the has been a change on this property already then we need to reuse the previous value |
| 10771 | if (changes[key]) { |
| 10772 | previousValue = changes[key].previousValue; |
| 10773 | } |
| 10774 | // Store this change |
| 10775 | changes[key] = new SimpleChange(previousValue, currentValue); |
| 10776 | } |
| 10777 | } |
| 10778 | |
| 10779 | function triggerOnChangesHook() { |
| 10780 | destination.$onChanges(changes); |
no test coverage detected