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.
replace directive $element still references replaced DOM element #7900
Closed
Description
...if using jQuery instead of jqLite because the jQuery $element still references the replaced DOM element as the context. This only occurs if the element is replaced and not cloned since cloning creates a new jQuery object instead of just modifying the compiled $element. (http://plnkr.co/edit/vGwzc1FGt127pQ1wbKNT?p=preview)
This isn't huge, and isn't really a memory leak because it will get destroyed along with the $element, but it would be nice if the replaced DOM was cleaned up. I think this can be fixed in the $compile replaceWith
helper by properly clearing the jQuery context...
edit: I originally had something about replace & -start/end in here too but that seems unrelated.