angular ng-bind-html and directive within it

前端 未结 6 1778
北荒
北荒 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:04

    Unfortunately I don't have enough reputation to comment.

    I could not get this to work for ages. I modified my ng-bind-html code to use this custom directive, but I failed to remove the $scope.html = $sce.trustAsHtml($scope.html) that was required for ng-bind-html to work. As soon as I removed this, the compile function started to work.

提交回复
热议问题