How to output html through AngularJS template?

后端 未结 5 2057
醉梦人生
醉梦人生 2020-12-15 16:27

{{ revision.title }}

The title outputs fine, but the content - does

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-15 17:27

    I know it's an older question, but you can also trust the value using $sce in your controller:

    $scope.revision.content = $sce.trustAsHtml($scope.revision.content);
    

    After that, ng-bind-html will work.

提交回复
热议问题