Ideally, you should avoid this.
However, if you really need to, then you can enter and use the $compile service, followed by element.append .
If your directive does not need access to a specific area, then you can even assign the $compile and $rootScope window $rootScope in the run function of your application module, and then use them externally from the angular context, creating a new scope ( $rootScope.new() ) and complete adding an item using $rootScope.apply() .
musically_ut Nov 18 '13 at 22:38 2013-11-18 22:38
source share