I have an issue where I can't send compiled HTML to an external function. I can do it if I do everything within the Angular app space. But when I send my compiled result to an external function it is not rendering anymore. Anyone got any idea why this isn't working, or even better a solution how to make it work?
My external function (exists outside of the angular app)
<script>
var ext = {};
ext.addFunction(elem) {
$('#eventListExtFunction').html(elem);
}
</script>
My directive (calls the external function with the compiled HTML)
var eventListElem = angular.element('<event-list-ext></event-list-ext>'),
extElem = $compile(eventListElem)(scope);
// Add to external through function
ext.addFunction(extElem);
See this plunker for more info about what I am trying to accomplish: http://plnkr.co/edit/HkCGFsBX751oPyXgzKEn?p=preview
ReferenceError: ext is not defined! what isext?