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


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

    <div ng-repeat="item in list" >
            <div ng-bind-html="item.content |trustHtml"></div>
    </div>

    2.项目中如果ng-repeat = “item in list”

    <li ng-repeat="item in msgList" class="clr" >
                <div class="chat-dialog-time" ng-show= "item.send_time1 != ''">{{item.send_time1}}</div>
                <!--<div ng-class="{true: 'chat-dialog-news-mine', false: 'chat-dialog-news-other'}[{{item.isOwn}}]" 
            msgId="{{item.imdn_id}}">--> <div ng-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}}"> <div contextmenu="supermenu" ng-right-click="decrementRight($event,item)"> <i class="icon warn-icon" ng-if="item.isWarn" ng-click="reSendFile(item)"></i> <i ng-class="{true: 'icon {{item.status}}', false: ''}[{{item.isOwn && item.status !== ''}}]"></i> <i ng-class="{true: 'bubble-icon right-icon', false: 'bubble-icon left-icon'}[{{item.isOwn}}]"></i> <span compile='item.content|trustHtml' ng-click="newsClick($event, item)"
    ng-dblclick="newsDBClick($event, item)"></span> </div> <!--<span ng-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>
     
  • 相关阅读:
    面向过程(或者叫结构化)分析方法与面向对象分析方法到底区别在哪里?请根据自己的理解简明扼要的回答
    当下大部分互联网创业公司为什么都愿意采用增量模型来做开发?
    0
    计算机网络
    java基础
    java 多线程编程
    java类与对象,用程序解释
    修饰符的探讨
    java学习总结02
    java day1
  • 原文地址:https://www.cnblogs.com/sxz2008/p/6430307.html
Copyright © 2020-2023  润新知