AngularJS: Memory Leak with ng-repeat using custom objects (w/simple PLUNKR) #11169
Description
(SIMPLE PLUNKR HERE: http://plnkr.co/edit/1Adh2P65ZS8YHYJZhLMk)
(DETAILED STACKOVERFLOW EXPLANATION HERE: http://stackoverflow.com/questions/28683992/angularjs-memory-leak-with-ng-repeat-using-custom-objects-w-simple-plunkr)
SUMMARY:
There is a leak using ng-repeat after the 2nd wave iterating over an array of custom objects like this :
<div ng-repeat="d_sampleObject in mySampleObjects">
{{d_sampleObject.description}}
</div>
NOTE: 'mySampleObjects' is an array of the following object instances:
ml.MySampleObject = function (id) {
this.id = id;
this.description = 'this is object #:' + ' '+id;
}
Memory profile reveals an extra 'd_sampleObject' left over and not de-referenced. More details (via a controller and an injected service) in the Stackoverflow link above. A simple demonstration also in the provided plunkr link. Any thoughts and help greatly appreciated in advance!