So far, I haven't seen anyone attempting to this, so I'm wondering if it might be a lost cause. What I'm trying to do is use a jQuery UI dialog on an AngularJS page, but I'd like to use Angular's data-binding on the content of the dialog. The problem is that after you create a structure like this:
<body>
<div ng-controller="MyController">
<div id="modal">
{{ name }}
</div>
</div>
</body>
once you create the dialog with $('#modal').dialog(...), jQuery UI moves the content to a new div right before the body close tag. So the DOM ends up something like this, roughly:
<body>
<div ng-controller="MyController">
</div>
<div id="modal">
{{ name }}
</div>
</body>
The dialog content is no longer located within the controller's block, and Angular has all sorts of problems with that.
Anybody have any ideas? I'm not aware of any jQuery UI options to disable moving of the element. I'm hesitant to start using another dialog plugin, because jQuery UI is already in use throughout the site, and I want to keep the UI consistent. But maybe that's the only way to get around the problem...