I am using AngularJS version 1.5.6. I have a large application with lots of text areas and text inputs. I discovered a bug today caused by the default AngularJS behavior of trimming input for text type inputs. I would like to change this behavior from trimming by default to not trimming by default.
Is there an easy way to do this rather than to go through hundreds of textareas and text inputs in my application. (perhaps globally or writing my own directive?)
Here is the documentation page describing the default behavior of ng-trim (ngTrim).
The below directive should work for all the input type=text fields. It will set the value of ngTrim false by default for every input field. And a similar one can be created for the textarea if required.