angular ng-bind-html and directive within it

前端 未结 6 1750
北荒
北荒 2020-11-22 11:28

Plunker Link

I have a element which I would like to bind html to it.

That works.

6条回答
  •  醉梦人生
    2020-11-22 12:11

    Best solution what I've found! I copied it and it work's exactly as I needed. Thanks, thanks, thanks ...

    in directive link function I have

    app.directive('element',function($compile){
      .
      .
         var addXml = function(){
         var el = $compile('')($scope);
         $scope.renderingElement = el.html();
         }
      .
      .
    

    and in directive template:

    
    

提交回复
热议问题