Textarea: Let me start with linebreak

I am developing an Ionic / Cordova application. There textareais where the user can enter some data that is transmitted to the server.

Here the user should be able to enter line breaks. The problem that I am now facing is that it is possible only after entering the first character; and it’s impossible to start with a line break. ng-modeldisables initial line breaks. How can I achieve my goal?

textarea as follows:

<textarea ng-model="card.text" id="text-message" rows="20"></textarea>

Thank.

+4
source share
1 answer

https://github.com/angular/angular.js/issues/2010 ng-trim="false" , :

<textarea ng-model="card.text" ng-trim="false" id="text-message" rows="20"></textarea>
+3

Source: https://habr.com/ru/post/1661064/


All Articles