diff --git a/src/ng/compile.js b/src/ng/compile.js
index 741eaeb90..bc68eb04e 100644
--- a/src/ng/compile.js
+++ b/src/ng/compile.js
@@ -1893,7 +1893,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
attr = nAttrs[j];
name = attr.name;
- value = trim(attr.value);
+ value = attr.value;
// support ngAttr attribute binding
ngAttrName = directiveNormalize(name);
diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js
index 668f6c687..7ed97f062 100755
--- a/test/ng/compileSpec.js
+++ b/test/ng/compileSpec.js
@@ -4725,6 +4725,14 @@ describe('$compile', function() {
expect(componentScope.attrAlias).toEqual(componentScope.attr);
}));
+ it('should copy an attribute with spaces', inject(function() {
+ compile('
');
+
+ expect(componentScope.attr).toEqual(' some text ');
+ expect(componentScope.attrAlias).toEqual(' some text ');
+ expect(componentScope.attrAlias).toEqual(componentScope.attr);
+ }));
+
it('should set up the interpolation before it reaches the link function', inject(function() {
$rootScope.name = 'misko';
compile('');
diff --git a/test/ng/directive/ngListSpec.js b/test/ng/directive/ngListSpec.js
index 06b909872..4a62358ef 100644
--- a/test/ng/directive/ngListSpec.js
+++ b/test/ng/directive/ngListSpec.js
@@ -130,6 +130,12 @@ describe('ngList', function() {
helper.changeInputValueTo('a\nb');
expect($rootScope.list).toEqual(['a','b']);
});
+
+ it('should support splitting on whitespace', function() {
+ helper.compileInput('');
+ helper.changeInputValueTo('a b');
+ expect($rootScope.list).toEqual(['a','b']);
+ })
});
});