Angularjs以特殊字符呈现html

时间:2015-07-06 08:45:17

标签: html angularjs

我在上一个问题中并不是很清楚。然而,在看到服务器的响应再次询问相同之后。 html没有在这里呈现如何修复此

    Sub HideDoubleRst()
Application.ScreenUpdating = False    
    Dim UR As Long, X As Long
    Dim MyCol As Integer    
    MyCol = Range("A:A").Column
    UR = Cells(Rows.Count, MyCol).End(xlUp).Row
    For X = 2 To UR
        If Cells(X, MyCol) = Cells(X - 1, MyCol) And Cells(X, MyCol + 1) = Cells(X - 1, MyCol + 1) Then
        Rows(X).Select
        Selection.EntireRow.Hidden = True
        End If
    Next X

1 个答案:

答案 0 :(得分:2)

尝试这样的事情,

解码html字符串并将其传递给ng-bind-html

也添加jquery。

var myhtml  = "<div class="modal-body " id="mymodal">
<form name="" novalidate="" class="add-user ">
<fieldset>";

$scope.decodedText = $('<textarea />').html(myhtml).text();


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

DEMO

或者如果你不喜欢没有Jquery 使用它,

var myhtml = "&lt;div class=&quot;modal-body &quot; id=&quot;mymodal&quot;&gt;&lt;form name=&quot;ticketform&quot; novalidate=&quot;&quot; class=&quot;add-user-from add_ticket&quot;&gt;&lt;fieldset&gt;";

var txt = document.createElement("textarea");
txt.innerHTML = myhtml;

$scope.decodedText = txt.value;

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

DEMO