aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/directive/input.js12
-rw-r--r--src/directive/select.js6
-rw-r--r--test/directive/inputSpec.js8
3 files changed, 13 insertions, 13 deletions
diff --git a/src/directive/input.js b/src/directive/input.js
index cb6a8f96..0552be64 100644
--- a/src/directive/input.js
+++ b/src/directive/input.js
@@ -374,7 +374,7 @@ function textInputType(scope, element, attr, ctrl) {
if (ctrl.viewValue !== value) {
scope.$apply(function() {
- ctrl.read(value);
+ ctrl.setViewValue(value);
});
} else if (touched) {
scope.$apply();
@@ -559,7 +559,7 @@ function radioInputType(scope, element, attr, ctrl) {
if (element[0].checked) {
scope.$apply(function() {
ctrl.touch();
- ctrl.read(attr.value);
+ ctrl.setViewValue(attr.value);
});
};
});
@@ -580,7 +580,7 @@ function checkboxInputType(scope, element, attr, ctrl) {
element.bind('click', function() {
scope.$apply(function() {
ctrl.touch();
- ctrl.read(element[0].checked);
+ ctrl.setViewValue(element[0].checked);
});
});
@@ -830,7 +830,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', 'ngModel',
/**
* @ngdoc function
- * @name angular.module.ng.$compileProvider.directive.ng-model.NgModelController#read
+ * @name angular.module.ng.$compileProvider.directive.ng-model.NgModelController#setViewValue
* @methodOf angular.module.ng.$compileProvider.directive.ng-model.NgModelController
*
* @description
@@ -845,7 +845,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', 'ngModel',
*
* @param {string} value Value from the view
*/
- this.read = function(value) {
+ this.setViewValue = function(value) {
this.viewValue = value;
forEach(this.parsers, function(fn) {
@@ -1042,7 +1042,7 @@ var ngModelInstantDirective = ['$browser', function($browser) {
if (ctrl.viewValue !== value) {
scope.$apply(function() {
- ctrl.read(value);
+ ctrl.setViewValue(value);
});
} else if (touched) {
scope.$apply();
diff --git a/src/directive/select.js b/src/directive/select.js
index 627722ba..3cd1b99c 100644
--- a/src/directive/select.js
+++ b/src/directive/select.js
@@ -168,7 +168,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
selectElement.bind('change', function() {
scope.$apply(function() {
ctrl.touch();
- ctrl.read(selectElement.val());
+ ctrl.setViewValue(selectElement.val());
});
});
}
@@ -190,7 +190,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
}
});
ctrl.touch();
- ctrl.read(array);
+ ctrl.setViewValue(array);
});
});
}
@@ -270,7 +270,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
ctrl.touch();
if (ctrl.viewValue !== value) {
- ctrl.read(value);
+ ctrl.setViewValue(value);
}
});
});
diff --git a/test/directive/inputSpec.js b/test/directive/inputSpec.js
index 5a0c4168..e7c40b0a 100644
--- a/test/directive/inputSpec.js
+++ b/test/directive/inputSpec.js
@@ -113,7 +113,7 @@ describe('NgModelController', function() {
describe('view -> model', function() {
it('should set the value to $viewValue', function() {
- ctrl.read('some-val');
+ ctrl.setViewValue('some-val');
expect(ctrl.viewValue).toBe('some-val');
});
@@ -131,7 +131,7 @@ describe('NgModelController', function() {
return value + '-b';
});
- ctrl.read('init');
+ ctrl.setViewValue('init');
expect(log).toEqual(['init', 'init-a']);
expect(ctrl.modelValue).toBe('init-a-b');
});
@@ -141,13 +141,13 @@ describe('NgModelController', function() {
var spy = jasmine.createSpy('$viewChange');
scope.$on('$viewChange', spy);
- ctrl.read('val');
+ ctrl.setViewValue('val');
expect(spy).toHaveBeenCalledOnce();
spy.reset();
// invalid
ctrl.parsers.push(function() {return undefined;});
- ctrl.read('val');
+ ctrl.setViewValue('val');
expect(spy).not.toHaveBeenCalled();
});
});