angular / angular.js

AngularJS - HTML enhanced for web apps!
https://angularjs.org
MIT License
58.85k stars 27.52k forks source link

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

Open gschumm opened 11 years ago

gschumm commented 11 years ago

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://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.

btford commented 10 years ago

What's your use case?

gschumm commented 10 years ago

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.