【发布时间】:2018-02-23 13:56:26
【问题描述】:
我正在从服务中获取对象列表。我使用 ng-repeat 在 ui 中显示 json 对象数据。
<div class="agreementPopover" ng-repeat="pm in list">
<p class="md-subhead robotoMedium bodyFontColor zeroMrgn" >{{pm.des}}</p>
<p class="md-subhead blackColour btmMrgn" ng-bind-html="pm.html| renderHTML"></p>
</div>
我创建了一个自定义过滤器来将我的 html 转换为信任 html。
filter('renderHTML', ['$sce', function($sce) {
return function(val) {
return $sce.trustAsHtml(val);
};
}])
问题是我的 UI 中没有显示动态 html 内容。
我的 Html 内容是
<a href="http://force.com/PublicKB/articles/FAQ/What-is-the-for-Program/?q=letter+of+credit&l=en_US&fs=RelatedArticle" target="_blank" class="agreementPaymentLink">www.skip.com</a>
【问题讨论】:
标签: angularjs angularjs-directive angularjs-material