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.
Removing part of transclude destroys transclusion scope. #5703
Closed
Description
Hi,
I have a directive which has an isolated scope, template and transclusion. I use the transclude function in the directive's link (as expected the transclusion is bound to the parent scope, not the isolated one) to clone the template and add it to the dom. The transclusion contains several elements.
As part of the directive I sometimes remove a single element that was part of the transcluded content from the dom. This triggers $destroy on the element which destroys the transclusion scope (although there are still other elements that use it).
The $destroy binding is done in createBoundTranscludeFn().
Unless I'm missing something this seems like a bug to me.