【问题标题】:How to consume html value of rest web service response in angular js如何在angular js中使用rest web服务响应的html值
【发布时间】:2017-10-03 14:43:47
【问题描述】:

我正在使用 RESTful Web 服务,我得到了 html div 标签格式的值,如何在 Angular js 中处理它并在视图部分显示相同的 这是回复

reponse : {
         "results": [
            {
               "location": "<div class=\"ExternalClass5F47052A5E8540409190A07B0D2A376F\"><p>abcddd<\/p><\/div>",
               "Status": "0",
               "Comments": null,


            },
            {
               "location": "<div class=\"ExternalClass7013B125F9C148559C1DF779BDF05553\">xyzz<\/div>",
               "Status": "0",
               "Comments": null,

            }
         ]
      }

【问题讨论】:

    标签: javascript html angularjs web-services ionic-framework


    【解决方案1】:

    您可以使用Ng-bind-html 之类的东西

    <div ng-bind-html="yourhtmlresponse"></div>
    

    Here is working demo

    【讨论】:

    • 别忘了包含 ng-santize
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多