angular-feeds icon indicating copy to clipboard operation
angular-feeds copied to clipboard

Template gets added to dom multiple times and old feed is not cleared

Open wro opened this issue 10 years ago • 0 comments

I am using a dynamic url so everytime the url changes the feed is fetched again. Because the success handler for that call renders the template the template gets added to the DOM every time. Ideally the template should only be added to the DOM once. Additionally because the renderTemplate function iterates over the feed objects and adds them to the feeds on the scope the old feeds are maintained instead of cleared.

The result is that when initially 3 objects are rendered, when the url changes there are 12 because 3 additional objects were retrieved and stored in the same array and the template is rendered twice as well.

wro avatar Nov 13 '15 11:11 wro