Reputation: 3545
I have a list of objects where one of the properties is description
and the value has break lines as
.
I'm using the normal way to print it in my HTML, take a look below:
<div class="row" *ngFor="let item of items">
<p>{{item.description}}</p>
</div>
and in the result I can't see the break line, What I see is the description as below:
line 1 ` ` line 2 ` ` line 3
and should be something like:
line 1
line 2
line 3
Any idea how to solve it?
Upvotes: 0
Views: 5323
Reputation: 1187
The  
is an ISO character, same as space you shouldn't use it to write break lines.
You can use the <br>
tag and in the binding, use [innerHTML] ="ítem.description"
.
Upvotes: 6