Skip to content Skip to sidebar Skip to footer

Using Directive In Ng-bind-html

Im trying to call a directive to change view based on my tab click. My directive: Proj.directive('tab1', function() { return { restrict:'E', templateUrl:'partia

Solution 1:

This won't work, ng-bind-html will just insert HTML into the DOM tree without triggering AngularJS directives to be processed.

If you want to insert "live" HTML into the DOM, where all the directives are "live" you would have to compile it first (http://docs.angularjs.org/api/ng.$compile) and then attach to the DOM tree. This is usually done in a directive.

Post a Comment for "Using Directive In Ng-bind-html"