(key, currentValue, previousValue)
| 10827 | }); |
| 10828 | |
| 10829 | function recordChanges(key, currentValue, previousValue) { |
| 10830 | if (isFunction(destination.$onChanges) && !simpleCompare(currentValue, previousValue)) { |
| 10831 | // If we have not already scheduled the top level onChangesQueue handler then do so now |
| 10832 | if (!onChangesQueue) { |
| 10833 | scope.$$postDigest(flushOnChangesQueue); |
| 10834 | onChangesQueue = []; |
| 10835 | } |
| 10836 | // If we have not already queued a trigger of onChanges for this controller then do so now |
| 10837 | if (!changes) { |
| 10838 | changes = {}; |
| 10839 | onChangesQueue.push(triggerOnChangesHook); |
| 10840 | } |
| 10841 | // If the has been a change on this property already then we need to reuse the previous value |
| 10842 | if (changes[key]) { |
| 10843 | previousValue = changes[key].previousValue; |
| 10844 | } |
| 10845 | // Store this change |
| 10846 | changes[key] = new SimpleChange(previousValue, currentValue); |
| 10847 | } |
| 10848 | } |
| 10849 | |
| 10850 | function triggerOnChangesHook() { |
| 10851 | destination.$onChanges(changes); |
no test coverage detected