Doopler Doopler - 1 year ago 328
HTML Question

How to create a newline when retrieving data from firebase?

How have a long string and would like to seperate some of the text with a newline.

it seems \n or \n does not work or

What is in database:

description: "Hello \n world"

When I retrieve the data I get

Hello world

Instead of:



Answer Source

Wrap content in <pre> tag, so that will get formatted correctly on view.


Demo Here

Other options is to use ng-bind-html directive + add ngSanitize module in app depenency

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


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download