From 09a1e7af129880cab89a2f709f22a7286f52371e Mon Sep 17 00:00:00 2001
From: Mikk Kirstein
Date: Tue, 14 May 2013 20:14:06 +0300
Subject: fix(ngValue): made ngValue to write value attribute to element
---
src/ng/directive/input.js | 2 +-
test/ng/directive/inputSpec.js | 12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/src/ng/directive/input.js b/src/ng/directive/input.js
index 0c0b2df8..2d3210d5 100644
--- a/src/ng/directive/input.js
+++ b/src/ng/directive/input.js
@@ -1335,7 +1335,7 @@ var ngValueDirective = function() {
} else {
return function(scope, elm, attr) {
scope.$watch(attr.ngValue, function valueWatchAction(value) {
- attr.$set('value', value, false);
+ attr.$set('value', value);
});
};
}
diff --git a/test/ng/directive/inputSpec.js b/test/ng/directive/inputSpec.js
index 86fad41a..36fb754d 100644
--- a/test/ng/directive/inputSpec.js
+++ b/test/ng/directive/inputSpec.js
@@ -1136,6 +1136,18 @@ describe('input', function() {
describe('ngValue', function() {
+ it('should update the dom "value" property and attribute', function() {
+ compileInput('');
+
+ scope.$apply(function() {
+ scope.value = 'something';
+ });
+
+ expect(inputElm[0].value).toBe('something');
+ expect(inputElm[0].getAttribute('value')).toBe('something');
+ });
+
+
it('should evaluate and set constant expressions', function() {
compileInput('' +
'' +
--
cgit v1.2.3