0

I've a textarea which gives the user to add comments.

<li ng-repeat="assesment in items">
    <textarea type="text" ng-model="assesment.currentComment" class="form-control input-sm" ng-enter="addComment(assesment)" ng-blur="setNewCommentEdit(true)" placeholder="Comment..." style="resize:vertical" />
</li>

Now when the user edits the text saves and reload the page all linebreaks are gone. The linebreaks are stored correctly in the database What am I doing wrong ?

I also tried to wrap the textarea in a <pre> tag like desribed here but that did not help

Community
  • 1
  • 1
Boas Enkler
  • 12,264
  • 16
  • 69
  • 143

1 Answers1

0
<li ng-repeat="assesment in items">
<textarea type="text" ng-model="assesment.currentComment" class="form-control input-sm" ng-enter="addComment(assesment)" ng-blur="setNewCommentEdit(true)" placeholder="Comment..." style="resize:vertical">   <pre>{{assesment.currentComment}}</pre>   </textarea>

I hope it'd work.

micronyks
  • 54,797
  • 15
  • 112
  • 146