AngularJS is rendering
as text not as a newline

后端 未结 5 1183
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-14 00:10

I am sure this has been asked before but I cannot find the answer.

I have an AngularJS script that is pulling from a DB and then rendering to content. Everything is

5条回答
  •  借酒劲吻你
    2020-12-14 00:46

    I've used like this

    function chatSearchCtrl($scope, $http,$sce) {
     // some more my code
    
    // take this 
    data['message'] = $sce.trustAsHtml(data['message']);
    
    $scope.searchresults = data;
    

    and in html I did

    thats it I get my
    tag rendered

提交回复
热议问题