Provide an option not to trim the value of input
See the demo: http://jsfiddle.net/Freewind/A8VzX/
If you input something has leading or ending spaces, they will be automatically trimmed.
This is fine for most cases, but sometimes, I need the original value.
e.g. I hope the uses can input some markdown code block(which has 4 leading spaces), but I have no idea how to do this.
The trimming code of angular is here: https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L373
I think trimmed value is good for "number" or "url" inputs, but not always for a normal text input.
I hope angular can provide an option to control it trim or not.
+1
+2
A feature to resolve this has already been committed: https://github.com/angular/angular.js/commit/d519953a4b219035587e3fcb2e9cc52e02b408ca
Thanks. I checked the 1.1 release, but didn't find it in there. Do you know when it will make it in? (In the meantime I've hacked my own local copy: https://groups.google.com/forum/#!topic/angular/culutawXUx8)
This fix is now available (1.1.1 release).
Yes, landed as https://github.com/angular/angular.js/commit/d519953a4b219035587e3fcb2e9cc52e02b408ca