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.

Wrapping root text elements of $compile in span causes issues #1059

Closed
@mhevery

Description

@mhevery

$compile wraps root text elements in span's so that it can attach data elements. This cause issues with transclusion since it can add int

Activity

cristatus

cristatus commented on Jul 6, 2012

@cristatus

At least empty nodes should be ignored.

if (node.nodeType == 3 /* text node */ && node.childNodes.length /* non-empty */) {
  $compileNode[index] = jqLite(node).wrap('<span>').parent()[0];
}
boneskull

boneskull commented on Jul 13, 2012

@boneskull
Contributor

I'm having this issue as well. This code fixes the problem. Thanks!

woeye

woeye commented on Jan 8, 2013

@woeye

Yeah, transcluding a more complex body of an element (and not just some hello world stuff) results currently in a huge bloat of empty spans. If you care about your markup (and you should) this issue is really a no go.

added a commit that references this issue on Jan 17, 2013
d647b60
added a commit that references this issue on Jan 17, 2013
0d8e19c
added a commit that references this issue on Jan 18, 2013
0196bc8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Wrapping root text elements of $compile in span causes issues · Issue #1059 · angular/angular.js