angular-ui/bootstrap — pull request #369 by joshdmiller (2013-04-29 21:11:49+00:00)
Title: feat(popover): created popover-template directive

I haven't created any tests because I'm not a fan of the approach. I am submitting this PR to open a dialog to see if anyone can think of a better way to implement this.

Specifically, I created a new (internal, undocumented, but nonetheless exported) directive called `ttLoadTemplateInSibling` that loads a template from a remote source, compiles it relative to a new sibling scope, and replaces the HTML content of itself with said template. This directive is used in the new `popoverTemplate` directive's template to load the passed template where it needs to go.

I couldn't think of any other way to do this while still compiling the template in the right scope (a new sibling to avoid the isolate scope) and without introducing knowledge of the template to the directive.