javascript - angularjs save html from textarea -
this html:
<div ng-if="!item.edit> <div class='door-description' ng-bind-html="item.description"></div> <div class='door-softvalues' ng-bind-html="item.softvalues" ng-if="item.isconfiguration"></div> </div> <div ng-if="item.edit"> <textarea elastic class='door-description' ng-bind-html="item.description" ng-model="item.description"></textarea> <textarea elastic class='door-softvalues' ng-bind-html="item.softvalues" ng-if="item.isconfiguration" ng-model="item.softvalues"></textarea> </div>
so linebreak looks when im in edit mode , edit textarea when save text , retrieve again looses linebreaks.
here looks when editing:
and here looks when not editing:
i can still toggle between edit , not editing , same result.
what have make linebreaks appear when not editing?
can try using pre tag:
<pre class='door-description' ng-bind-html="item.description"></pre>
Comments
Post a Comment