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

transclude bug in IE #7388

Closed
maxisam opened this issue May 7, 2014 · 5 comments
Closed

transclude bug in IE #7388

maxisam opened this issue May 7, 2014 · 5 comments

Comments

@maxisam
Copy link

maxisam commented May 7, 2014

Here is the example: plunker

It shows nothing in IE all version.

the way to walk around this bug is add space between "}}" and "</"

@petebacondarwin
Copy link
Contributor

This seems like a weird way to use transclusion. Shouldn't you simply be terminating compilation instead: http://plnkr.co/edit/ZZPeHx?p=preview

@petebacondarwin petebacondarwin added this to the Backlog milestone May 15, 2014
@maxisam
Copy link
Author

maxisam commented May 15, 2014

First of all, thank you for spending time on this. I think your answer is not an answer. It is more like a walk around.

It is just an example. It is not exactly how I used it. #6751 is the original case and it shows you why I used transclusion.

@onethread
Copy link

Got the same bug while doing transclusion with manually added ngRepeats.

In the function "addTextInterpolateDirective", node will be valid and correctly pointing to the text node when textInterpolateLinkFn is first called.

When the watch executes, node will be empty, and node[0] will fail. I'm not sure why. IE only.

return function textInterpolateLinkFn(scope, node) {
var parent = node.parent(),
bindings = parent.data('$binding') || [];
bindings.push(interpolateFn);
parent.data('$binding', bindings);
if (!hasCompileParent) safeAddClass(parent, 'ng-binding');
scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {
node[0].nodeValue = value;
});
};

Example code:

This <a href="#" tooltip-placement="left" tooltip="On the Left!"> {{amount.name}} </a>
is contained in a dynamically generated ng-repeat. Adding spaces around the {{}} fixes it in IE.

@gustavohenke
Copy link

I was also suffering from that nodeValue problem, and I can confirm that using some spaces around {{ }} fixes it.

@btford btford removed the gh: issue label Aug 20, 2014
@Narretz
Copy link
Contributor

Narretz commented Jan 22, 2016

This is the same issue as described here: #8659 (comment) and the next two comments.
Bottom line: don't compile the same node twice. It leads to unexpected results, and IE even throws.

@Narretz Narretz closed this as completed Jan 22, 2016
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

6 participants