I am using Angular.js 1.6. I noticed that any \n in textarea input field text is being removed before storing into the database. Is there a simple way to turn this behavior off?
Asked
Active
Viewed 70 times
0
-
have you tried using pre instead of textarea? – Rohlex32 Apr 03 '19 at 21:10
-
1AngularJS doesn't do that. If it really happens, it's in your code. My guess is that they are still there, but that you're displaying it in HTML, where \n is just treated as white space. – JB Nizet Apr 03 '19 at 21:29
-
Possible duplicate of [nl2br() equivalent in javascript](https://stackoverflow.com/questions/7467840/nl2br-equivalent-in-javascript) – Yassine CHABLI Apr 03 '19 at 22:27
-
When asking a question about a problem caused by your code, you will get much better answers if you provide code people can use to reproduce the problem. See [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). – georgeawg Apr 04 '19 at 00:10