From de0aad89844a81b273b1fe50f53f1148ef8d20f2 Mon Sep 17 00:00:00 2001 From: Jason Bedard Date: Thu, 29 Nov 2018 23:06:00 -0800 Subject: [PATCH] fix(ngRepeat): fix reference to last collection value remaining across linkages Ref #16776 --- src/ng/directive/ngRepeat.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ng/directive/ngRepeat.js b/src/ng/directive/ngRepeat.js index 9e29bbe18cba..903e27163bc6 100644 --- a/src/ng/directive/ngRepeat.js +++ b/src/ng/directive/ngRepeat.js @@ -592,6 +592,12 @@ var ngRepeatDirective = ['$parse', '$animate', '$compile', function($parse, $ani } } + // Clear the value property from the hashFnLocals object to prevent a reference to the last value + // being leaked into the ngRepeatCompile function scope + if (hashFnLocals) { + hashFnLocals[valueIdentifier] = undefined; + } + // remove leftover items for (var blockKey in lastBlockMap) { block = lastBlockMap[blockKey];