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

Transclusion breaks in some scenarios due to a bug fix #5060

Closed
fame opened this issue Nov 21, 2013 · 2 comments
Closed

Transclusion breaks in some scenarios due to a bug fix #5060

fame opened this issue Nov 21, 2013 · 2 comments

Comments

@fame
Copy link

fame commented Nov 21, 2013

This bug fix eed299a is breaking some transclusion scenarios and does not seems to have a work around.

The bug author is removing any thing inside the transclusion container which is causing the problem. Basically, he was asking for an empty container for transclusion.

Here is an example I am trying to do with bootstrap add on items with form elements.
Plunker with Angular 1.0.7 which works http://plnkr.co/edit/QT51rM7HOweE6tdmblEM
Same example with Angular 1.2.1 which does not work
http://plnkr.co/edit/bQcj6gXwbK7YJe7bGqUa

fame referenced this issue Nov 21, 2013
when the transluded content is being teleported to the translusion point, we should ensure that
the translusion point is empty before appending otherwise we end up with junk before the transcluded
content
@ghost ghost assigned IgorMinar Dec 2, 2013
@ghost ghost assigned btford Dec 9, 2013
@btford
Copy link
Contributor

btford commented Dec 11, 2013

ngTransclude was never meant to be able to append content. This is something that just happened to work because of its implementation details.

Soon, Angular will use the Shadow DOM to implement transclusion. When using the new Shadow DOM API, elements projected into <content> elements replace the existing content of the element. This change is important in aligning Angular with emerging web standards.

It's unfortunate that this breaks your directive, but there are several pragmatic approaches to fixing it. You can rewrite your directive to move the ngTransclude directive onto a different element and then fix up the CSS accordingly. You can manually do the transclusion, or create a directive with the append behavior as suggested here: eed299a#commitcomment-4685184

@btford btford closed this as completed Dec 11, 2013
@fame
Copy link
Author

fame commented Dec 12, 2013

Thanks Brian

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants