It’s because angularJS automatically trimmed your model.
If you’re using angularJS 1.1.1 or newer, add ng-trim="false"
to textarea
.
Working example: http://jsfiddle.net/9DbYY/
More Related Contents:
- How to use a keypress event in AngularJS?
- Directive isolate scope with ng-repeat scope in AngularJS
- AngularJS: ng-repeat list is not updated when a model element is spliced from the model array
- Enable angular-ui tooltip on custom events
- AngularJS : ng-repeat filter when value is greater than
- angularjs share data config between controllers
- AngularJS Group By Directive without External Dependencies
- How to use “ng-repeat” within template of a directive in Angular JS?
- What is `priority` of ng-repeat directive can you change it?
- How to detect browser using angularjs?
- How to set focus on input field?
- How to call a method defined in an AngularJS directive?
- Injecting $scope into an angular service function()
- Angularjs dynamic ng-pattern validation
- What is the difference between ng-app and data-ng-app?
- Easiest way to pass an AngularJS scope variable from directive to controller?
- Preserve line breaks in angularjs
- Using angularjs filter in input element
- if a ngSrc path resolves to a 404, is there a way to fallback to a default?
- calling method of parent controller from a directive in AngularJS
- Accessing attributes from an AngularJS directive
- Dynamically set the value of ui-sref Angularjs
- How to modify scope from within a directive in AngularJs
- How do I create an AngularJS UI bootstrap popover with HTML content?
- Can you change templateUrl on the fly?
- Understanding the transclude option of directive definition?
- How to integrate AngularUI to AngularJS?
- Binding inputs to an array of primitives using ngRepeat => uneditable inputs
- Two views in one AngularUI Router state sharing scope
- Highlighting a filtered result in AngularJS