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

$compile, built-in directives and jqLite not aware of owner document #3081

Open
gschumm opened this issue Jun 27, 2013 · 2 comments
Open

$compile, built-in directives and jqLite not aware of owner document #3081

gschumm opened this issue Jun 27, 2013 · 2 comments

Comments

@gschumm
Copy link

gschumm commented Jun 27, 2013

When adding angular elements to other frames or windows dynamically using $compile service a HierarchyRequestError is thrown in Internet Explorer.

Here is a simple example that demonstrates the issue:
http:https://plnkr.co/edit/47PFR8bJ7H58yHBmaX5S?p=preview

The problem is, that $compile, jqLite and built-in directives like ngInclude always create DOM elements (from HTML strings) in the document of the page where angular is loaded and not the document the nodes were added to. Some browsers, like Internet Explorer don't support adding nodes from a different document.

  • $compile should use the owner document of the given node and compile the rest in the context of this document.
  • jqLite should support a second argument for owner document like jQuery.
  • Built-in directives should use owner document of directive node
@btford
Copy link
Contributor

btford commented Jan 10, 2014

What's your use case?

@gschumm
Copy link
Author

gschumm commented Jan 11, 2014

I want to use angular.js in a project for a web portal (Microsoft SharePoint). The requirement is to use the default UI components whenever possible. The native UI provides an API for opening modal dialog windows with an HTML element as content. Content is rendered in an iframe by the system. I want to expand the angular app of the parent page also to the modal window.

@gschumm gschumm closed this as completed Jan 11, 2014
@gschumm gschumm reopened this Jan 11, 2014
@ashleygwilliams ashleygwilliams added this to the Ice Box milestone Feb 21, 2014
@btford btford removed the gh: issue label Aug 20, 2014
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