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

Empty scope spans created by ng-transclude #1293

Closed
ghost opened this issue Aug 26, 2012 · 8 comments
Closed

Empty scope spans created by ng-transclude #1293

ghost opened this issue Aug 26, 2012 · 8 comments

Comments

@ghost
Copy link

ghost commented Aug 26, 2012

Please read this:

https://groups.google.com/forum/?fromgroups=#!topic/angular/5SaF085FANw

Bottom line is that ng-transclude in directive templates creates spans with class="ng-scope" which breaks the layout.

@symblify
Copy link

Same as #1059, I think.

@Narretz
Copy link
Contributor

Narretz commented Jan 12, 2014

@piotrppe
Copy link

piotrppe commented Oct 6, 2016

It seems that ng-trasnclude is adding spans again in Angular 1.5.8. Works fine in 1.5.7

@gkalpak
Copy link
Member

gkalpak commented Oct 6, 2016

@stefanFruuu, can you provide a reproduction (e.g. a live demo using CodePen, Plnkr etc)?

@piotrppe
Copy link

piotrppe commented Oct 6, 2016

@piotrppe
Copy link

piotrppe commented Oct 6, 2016

  1. in case of 'simple' transclude ('transclude': true - plnkr above) spans are added in both 1.5.8 and 1.5.7

  2. in case of multi-slot transclude with optional slot and default value spans are not added in 1.5.7 (https://plnkr.co/edit/kQhXKe0qA4Kg5aZ4zLVQ,
    image
    )

    but are added in 1.5.8 (
    https://plnkr.co/edit/NiJOif6IEbZhWAhhNHZt
    image
    )

@gkalpak
Copy link
Member

gkalpak commented Oct 6, 2016

@stefanFruuu, indeed there is a difference. It has been introduced in 1.5.8 by 159a68e.

Previously, any fallback content was compiled as part of the parent template (even if that content would not be used). With 159a68e the fallback content will be compiled separately and only if necessary. A side effect of this separate compilation is that the fallback content is now treated as a template root and root text nodes are wrapped in <span>.

In 1.6.x there will be no extra <span> whatsoever, but this change is indeed undesirable for 1.5.x 😞
We'll look into it.

@stefanFruuu, could you create a separate issue to track that regression?

@piotrppe
Copy link

piotrppe commented Oct 6, 2016

Thanks for explanation! I've created new issue: #15223

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

No branches or pull requests

5 participants