I have a web page with a module defined (myModule) where I'm boostraping angularjs using
angular.bootstrap(element,[myModule.name]);
After the click of a button, I add dynamic html and compile using
$compile('<my-element data="data"></my-element>',$scope.$new());
The directive is added using
myModule.directive('myElement',function(){});
The problem is when I add the directive before calling bootstrap, $compile ends up correctly processing my directive. However, if the directive is added after calling bootstrap, $compile does not do anything to my html. It just adds the class ng-scope to it and the directive/tag is not processed.
In my case, not all the directives will be loaded before bootstrap is called. In the case where I load directives after calling bootstrap, how do I get to use it within the page?
Thanks.
Edit: Just to clarify. All directives are loaded dynamically. Those I load before bootstrapping work fine. Those I load after bootstrapping fails. When I swap the directives loaded, I can the same result so it is not the directives but appears to be that after bootstrapping, newly added directives does not seem to take effect.