IE8 oddness with nested directives & transclude
Here's an issue we've been chasing down in IE8. In some circumstances we have directive templates, which contain other directives, and they all incorporate their own transclude content. This is very powerful, and working great in Chrome, and IE9. But in IE8 it seems like the nested transclude content is not being transcluded at all.
http://jsfiddle.net/ItsLeeOwen/pSPeV/
Hi, We are experiencing a similar issue - here's our fiddle that isolates it - it throws an error in ie8:
http://jsfiddle.net/edeustace/LAgTR
@ItsLeeOwen I'm hunting down a similar issue, but FYI your fiddle does work for me in IE8. Did you do anything to fix it?
@ItsLeeOwen @sbeam did you happen to find a good workaround for this problem? It's still a big issue for us.
Unfortunately not, we've had to consider this not possible with angular projects that require IE8 support. On Nov 7, 2012 8:48 AM, "evaneus" [email protected] wrote:
@ItsLeeOwen https://github.com/ItsLeeOwen @sbeamhttps://github.com/sbeamdid you happen to find a good workaround for this problem? It's still a big issue for us.
— Reply to this email directly or view it on GitHubhttps://github.com/angular/angular.js/issues/1392#issuecomment-10155366.
To workaround this issue - We are going to look at using attributes instead of node names. Here's a gist: https://gist.github.com/e4ec72f6ff5ea6f98759
I had the following structure (directive1 has transclude=true, replace=true):
<directive1>
<directive1>
<form>
<fieldset>
<input />
</fieldset>
</form>
</directive1>
<directive1>
It fails in IE8 as discussed above.
If I use inner directive1 as an attribute, then it shows content, but this time I see inner directive1 displayed twice - one with the content and another one just empty.
If I move form element outside of inner directive1 then it works in all browsers (ie8, FF, Chrome):
<directive1>
<form>
<fieldset>
<directive1>
<input />
</directive1>
</fieldset>
</form>
<directive1>
Has anyone patched the angular directives code with a fix for this?
Hi ItsLeeOwen.. as edeustace was mentioning... we worked around it by matching directives on attributes/classes instead of element name.
Thanks for your reply evaneus, jsfiddle's new version isn't working in IE8 so I can't test quickly, but are you saying that by using an attribute directive instead of element directive, it works?
Yes, using restrict: "A" instead of "E" does seem to work in IE8. Thanks guys x39! :D
I also ran into this issue. Using restrict: "A" instead of "E" works in IE8. Would be nice to be able to use the element version and not have to modify all my existing directives in this big project.
We are also experiencing this issue. Please look into fixing this, as it's been open for 10 months now.
yes - I am following this bug as well
Also note that you don't have to do just restrict: 'A' you can use restrict: 'EA' and then you can use the element form of the directive when not nesting, and the attribute form of the directive when nesting.
This definitely needs to be fixed. Refactoring the application to use attribute directives instead of element directives is not a good workaround for the problem.
Is this an Angular issue or an IE8 issue? (I'm asking to see if it's something the community--including me--could investigate a fix for?) Anyone know off hand?
Closing this issue since 1.3 is not supporting IE8. If there's a non-hacky way to fix this issue, a PR would likely be accepted.
document.createElement('custom'); doesn't seem to do anything for custom elements nested inside of other custom elements.
IE8 is no longer supported, and Microsoft (and everyone else) would absolutely love it if people were encouraged to upgrade rather than struggle to make things work in a very quirky browser