angularjs - why trim content
Angularjs will automatically trim text content. How to disable it?
HTML
<html ng-app="MyApp">
<body>
<div ng-controller='MyCtrl'>
Input something has leading or ending spaces, you will see which will be trimed:
<hr/>
<input type="text" ng-model="name" />
Hello, [{{name}}]!
trim
</div>
</body>
</html>
CSS
</style>
<script src="http://code.angularjs.org/angular-1.0.0rc10.min.js"></script>
<style>
JavaScript
var app = angular.module('MyApp', []);
app.controller('MyCtrl', ['$scope', function($scope) {
$scope.show = function() {
alert('['+$scope.name+']');
};
}]);