封装成过滤器只是为了方便使用
app.filter('to_trusted',['$sce',function ($sce) { return function (text) { return $sce.trustAsHtml(text); };
}]);
html code:
<p ng-bind-html="currentWork.description | to_trusted"></p>原文链接:https://www.f2er.com/angularjs/147483.html
封装成过滤器只是为了方便使用
app.filter('to_trusted',['$sce',function ($sce) { return function (text) { return $sce.trustAsHtml(text); };
}]);
html code:
<p ng-bind-html="currentWork.description | to_trusted"></p>原文链接:https://www.f2er.com/angularjs/147483.html