I want that the user can insert a text in an input field with multiple lines with the enter key. Then I want so save the text in a string and then send it to the backend. On the Detail-Page of the app I want to show the inserted text but with line breaks.
In the html file for the Input I tried this
<div>
<ion-item>
<ion-textarea rows="5" name="description" type="text"
placeholder="Description" [(ngModel)]="description" required>
</ion-textarea>
</ion-item>
</div>
In the .ts I encode the string of description
this.description = encodeURI(this.description);
But when I want to show the inserted Text in the other html File
<ion-col size="12">
<div class="idea-description">
<ion-text style = "white-space: pre-wrap;">{{ idea.description }}</ion-text>
</div>
it only shows the encoded text but there are no line breaks.