Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

AngularJS: Memory Leak with ng-repeat using custom objects (w/simple PLUNKR) #11169

Closed
@momoadeli

Description

@momoadeli

(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!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions