File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1335,7 +1335,7 @@ var ngValueDirective = function() {
1335
1335
} else {
1336
1336
return function ( scope , elm , attr ) {
1337
1337
scope . $watch ( attr . ngValue , function valueWatchAction ( value ) {
1338
- attr . $set ( 'value' , value , false ) ;
1338
+ attr . $set ( 'value' , value ) ;
1339
1339
} ) ;
1340
1340
} ;
1341
1341
}
Original file line number Diff line number Diff line change @@ -1136,6 +1136,18 @@ describe('input', function() {
1136
1136
1137
1137
describe ( 'ngValue' , function ( ) {
1138
1138
1139
+ it ( 'should update the dom "value" property and attribute' , function ( ) {
1140
+ compileInput ( '<input type="submit" ng-value="value">' ) ;
1141
+
1142
+ scope . $apply ( function ( ) {
1143
+ scope . value = 'something' ;
1144
+ } ) ;
1145
+
1146
+ expect ( inputElm [ 0 ] . value ) . toBe ( 'something' ) ;
1147
+ expect ( inputElm [ 0 ] . getAttribute ( 'value' ) ) . toBe ( 'something' ) ;
1148
+ } ) ;
1149
+
1150
+
1139
1151
it ( 'should evaluate and set constant expressions' , function ( ) {
1140
1152
compileInput ( '<input type="radio" ng-model="selected" ng-value="true">' +
1141
1153
'<input type="radio" ng-model="selected" ng-value="false">' +
You can’t perform that action at this time.
0 commit comments