您的位置:首页 > Web前端 > HTML

如何让在Html中特殊字符被数据加载时对于html标签的自动转义 补充

2017-02-22 18:02 465 查看
1、将此过滤器添加到ng-bind-html所绑定的数据中,便实现了在数据加载时对于html标签的自动转义。

<divng-repeat="iteminlist">
<divng-bind-html="item.content|trustHtml"></div>
</div>


2.项目中如果ng-repeat=“iteminlist”

<ling-repeat="iteminmsgList"class="clr">
<divclass="chat-dialog-time"ng-show="item.send_time1!=''">{{item.send_time1}}</div>
<!--<divng-class="{true:'chat-dialog-news-mine',false:'chat-dialog-news-other'}[{{item.isOwn}}]"
        msgId="{{item.imdn_id}}">-->
<divng-class="{'chat-dialog-news-mine':{{item.isOwn}},'chat-dialog-news-other':{{!item.isOwn}},
'chat-dialog-news-file':{{item.content_type==6}},'chat-dialog-news-mine-file':{{item.isOwn}}&&{{item.content_type==6}},
'chat-dialog-news-other-file':{{!item.isOwn}}&&{{item.content_type==6}}}"msgId="{{item.imdn_id}}">
<divcontextmenu="supermenu"ng-right-click="decrementRight($event,item)">
<iclass="iconwarn-icon"ng-if="item.isWarn"ng-click="reSendFile(item)"></i>
<ing-class="{true:'icon{{item.status}}',false:''}[{{item.isOwn&&item.status!==''}}]"></i>
<ing-class="{true:'bubble-iconright-icon',false:'bubble-iconleft-icon'}[{{item.isOwn}}]"></i>
<spancompile='item.content|trustHtml'ng-click="newsClick($event,item)"
ng-dblclick="newsDBClick($event,item)"></span>
</div>

<!--<spanng-if="!item.isWarn"ng-show="{{item.need_read_report==1||item.need_read_report}}"
ng-class="{true:'chat-news-read',false:'chat-news-unread'}[{{item.is_read==1}}]">-->
<!--{{item.is_read_report==1?'已读':'未读'}}-->
<!--</span>-->
</div>



                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐