Angular is a DOM element leak when I use ngRepeat with a route service.
Our application has a table with search results. When the user clicks the next button in the pagination control, the application changes the route. So, it http://website/results/1will http://website/results/2, this will cause an angular call to compile in the ngRepeat directive, which clears it. DOM elements and $ scope objects in the cache stick together and leak.
You can see the same problem on http://docs.angularjs.org/api/
Go to the site above, open the developer tools and run the timeline. Then start clicking on the navigation on the left. Start at the top and keep pressing until you reach the bottom of the navigator, and then go back.
You will see that the DOM Node account just keeps growing and never gets any fully collected garbage.
This is a real problem.
My question is: anyone now how to fix this? Is there any work around?
Also, as a side note, but still related to the fact that angular seems to flow every element that wraps the inline expression. {{ObjectOnTheScope}}
source
share