AngularJS: Using $compile on html that contains directives with templateurl
I have a legacy application that has some content inserted into the DOM via jQuery. I would like the legacy parts of the codebase to be responsible for compiling the html that it inserts into the DOM. I can get it to compile the initial html using $compile , but any DOM elements added by a directive's template or templateUrl are not compiled, unless I call $scope.$apply() from within the directive itself. What am I doing wrong here? Link to fiddle: http://jsfiddle.net/f3dkp291/15/ index.html <div ng-app="app"> <debug source='html'></debug> <div id="target"></div> </div> application.js angular