(key, currentValue, previousValue)
| 10845 | }); |
| 10846 | |
| 10847 | function recordChanges(key, currentValue, previousValue) { |
| 10848 | if (isFunction(destination.$onChanges) && !simpleCompare(currentValue, previousValue)) { |
| 10849 | // If we have not already scheduled the top level onChangesQueue handler then do so now |
| 10850 | if (!onChangesQueue) { |
| 10851 | scope.$$postDigest(flushOnChangesQueue); |
| 10852 | onChangesQueue = []; |
| 10853 | } |
| 10854 | // If we have not already queued a trigger of onChanges for this controller then do so now |
| 10855 | if (!changes) { |
| 10856 | changes = {}; |
| 10857 | onChangesQueue.push(triggerOnChangesHook); |
| 10858 | } |
| 10859 | // If the has been a change on this property already then we need to reuse the previous value |
| 10860 | if (changes[key]) { |
| 10861 | previousValue = changes[key].previousValue; |
| 10862 | } |
| 10863 | // Store this change |
| 10864 | changes[key] = new SimpleChange(previousValue, currentValue); |
| 10865 | } |
| 10866 | } |
| 10867 | |
| 10868 | function triggerOnChangesHook() { |
| 10869 | destination.$onChanges(changes); |
no test coverage detected