Sophie Sophie - 11 months ago 59
HTML Question

HTML break line using <br> tag in <p> tag

In my HTML, I am using to show some text, like this:

<p> {{}} </p>

And here is the sample of bio object:

"bio": "A<br>B<br>C<br>D<br>E<br>F"

I was expecting that I'll get each and every alphabet in separate lines, but worst thing is when I run my HTML, showing me text as it is written with

Answer Source

Evaluates the expression and inserts the resulting HTML into the element in a secure way. Use ngSanitize in your module's dependencies.

Your code would we like:

<p ng-bind-html=""></p>

For more details read here.