Convert String to HTML widget Service Portal

chidanandadhath
Kilo Guru

I want to display Description in HTML... The description is in point wise, when displayed the contents are not coming in next line

<div class="content">
  <p ng-bind-html="c.data.textP1"></p>
</div>
5 REPLIES 5

SatheeshKumar
Kilo Sage

Hi,

In your controller pass in "$sce" to the function:

function($sce) {

        var c = this;

        c.data.textP1 = $sce.parseAsHtml( <your input value> );

}

And then in your HTML use:

 

<div ng-bind-html="c.data.textP1"></div>

 

-satheesh

 LinkedIn

chidanandadhath
Kilo Guru

is there anything I can do with gr.description in server script...since I'm appending those values with bunch of others

share your server and client code  to make necessary chnages in your code

 

Your script should work correctly if you have html content in your field it will be rendered as html, check the below image for reference.

 

find_real_file.png