Skip to content

Commit 23932a2

Browse files
Charlie-HuaNarretz
authored andcommitted
docs(ngModelOptions): add missing user.data result for updateOn: blur example
In the updateOn:blur example, there is an input for user.data but the result is missing and nowhere to see how the value changes compared to user.name. Closes angular#13129
1 parent 3ca4ca4 commit 23932a2

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/ng/directive/ngModel.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -1160,12 +1160,13 @@ var DEFAULT_REGEXP = /(\s+|^)default(\s+|$)/;
11601160
</label><br />
11611161
</form>
11621162
<pre>user.name = <span ng-bind="user.name"></span></pre>
1163+
<pre>user.data = <span ng-bind="user.data"></span></pre>
11631164
</div>
11641165
</file>
11651166
<file name="app.js">
11661167
angular.module('optionsExample', [])
11671168
.controller('ExampleController', ['$scope', function($scope) {
1168-
$scope.user = { name: 'say', data: '' };
1169+
$scope.user = { name: 'John', data: '' };
11691170
11701171
$scope.cancel = function(e) {
11711172
if (e.keyCode == 27) {
@@ -1180,20 +1181,20 @@ var DEFAULT_REGEXP = /(\s+|^)default(\s+|$)/;
11801181
var other = element(by.model('user.data'));
11811182
11821183
it('should allow custom events', function() {
1183-
input.sendKeys(' hello');
1184+
input.sendKeys(' Doe');
11841185
input.click();
1185-
expect(model.getText()).toEqual('say');
1186+
expect(model.getText()).toEqual('John');
11861187
other.click();
1187-
expect(model.getText()).toEqual('say hello');
1188+
expect(model.getText()).toEqual('John Doe');
11881189
});
11891190
11901191
it('should $rollbackViewValue when model changes', function() {
1191-
input.sendKeys(' hello');
1192-
expect(input.getAttribute('value')).toEqual('say hello');
1192+
input.sendKeys(' Doe');
1193+
expect(input.getAttribute('value')).toEqual('John Doe');
11931194
input.sendKeys(protractor.Key.ESCAPE);
1194-
expect(input.getAttribute('value')).toEqual('say');
1195+
expect(input.getAttribute('value')).toEqual('John');
11951196
other.click();
1196-
expect(model.getText()).toEqual('say');
1197+
expect(model.getText()).toEqual('John');
11971198
});
11981199
</file>
11991200
</example>
@@ -1219,7 +1220,7 @@ var DEFAULT_REGEXP = /(\s+|^)default(\s+|$)/;
12191220
<file name="app.js">
12201221
angular.module('optionsExample', [])
12211222
.controller('ExampleController', ['$scope', function($scope) {
1222-
$scope.user = { name: 'say' };
1223+
$scope.user = { name: 'Igor' };
12231224
}]);
12241225
</file>
12251226
</example>

0 commit comments

Comments
 (0)