Using Angular 5 and Firebase, I am storing and retrieving movie review information. When creating and editing the review, line breaks are kept (I assume using an ngModel has something to do with this). However, when retrieving the review from a reader's perspective, the ReviewComponent
, the line breaks are not kept. Logging the body still shows the line breaks and using Angular's json
pipe shows as text\n\ntext
showing where the line breaks should be.
Here is my HTML:
<main role="main" class="container">
<p style="margin-bottom: 2rem;">{{review.body}}</p>
</main>
I have also tried span
and body
.
How can I keep these line breaks in the review for the reader?