Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 2116857

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 #13129
1 parent 0f58334 commit 2116857

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
@@ -1141,12 +1141,13 @@ var DEFAULT_REGEXP = /(\s+|^)default(\s+|$)/;
11411141
</label><br />
11421142
</form>
11431143
<pre>user.name = <span ng-bind="user.name"></span></pre>
1144+
<pre>user.data = <span ng-bind="user.data"></span></pre>
11441145
</div>
11451146
</file>
11461147
<file name="app.js">
11471148
angular.module('optionsExample', [])
11481149
.controller('ExampleController', ['$scope', function($scope) {
1149-
$scope.user = { name: 'say', data: '' };
1150+
$scope.user = { name: 'John', data: '' };
11501151
11511152
$scope.cancel = function(e) {
11521153
if (e.keyCode == 27) {
@@ -1161,20 +1162,20 @@ var DEFAULT_REGEXP = /(\s+|^)default(\s+|$)/;
11611162
var other = element(by.model('user.data'));
11621163
11631164
it('should allow custom events', function() {
1164-
input.sendKeys(' hello');
1165+
input.sendKeys(' Doe');
11651166
input.click();
1166-
expect(model.getText()).toEqual('say');
1167+
expect(model.getText()).toEqual('John');
11671168
other.click();
1168-
expect(model.getText()).toEqual('say hello');
1169+
expect(model.getText()).toEqual('John Doe');
11691170
});
11701171
11711172
it('should $rollbackViewValue when model changes', function() {
1172-
input.sendKeys(' hello');
1173-
expect(input.getAttribute('value')).toEqual('say hello');
1173+
input.sendKeys(' Doe');
1174+
expect(input.getAttribute('value')).toEqual('John Doe');
11741175
input.sendKeys(protractor.Key.ESCAPE);
1175-
expect(input.getAttribute('value')).toEqual('say');
1176+
expect(input.getAttribute('value')).toEqual('John');
11761177
other.click();
1177-
expect(model.getText()).toEqual('say');
1178+
expect(model.getText()).toEqual('John');
11781179
});
11791180
</file>
11801181
</example>
@@ -1200,7 +1201,7 @@ var DEFAULT_REGEXP = /(\s+|^)default(\s+|$)/;
12001201
<file name="app.js">
12011202
angular.module('optionsExample', [])
12021203
.controller('ExampleController', ['$scope', function($scope) {
1203-
$scope.user = { name: 'say' };
1204+
$scope.user = { name: 'Igor' };
12041205
}]);
12051206
</file>
12061207
</example>

0 commit comments

Comments
 (0)