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

Commit 8c08b43

Browse files
committed
docs(ngList): fix example and add e2e test
1 parent 0b38882 commit 8c08b43

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ng/directive/input.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1227,8 +1227,9 @@ var requiredDirective = function() {
12271227
</script>
12281228
<form name="myForm" ng-controller="Ctrl">
12291229
List: <input name="namesInput" ng-model="names" ng-list required>
1230-
<span class="error" ng-show="myForm.list.$error.required">
1230+
<span class="error" ng-show="myForm.namesInput.$error.required">
12311231
Required!</span>
1232+
<br>
12321233
<tt>names = {{names}}</tt><br/>
12331234
<tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/>
12341235
<tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/>
@@ -1240,12 +1241,14 @@ var requiredDirective = function() {
12401241
it('should initialize to model', function() {
12411242
expect(binding('names')).toEqual('["igor","misko","vojta"]');
12421243
expect(binding('myForm.namesInput.$valid')).toEqual('true');
1244+
expect(element('span.error').css('display')).toBe('none');
12431245
});
12441246
12451247
it('should be invalid if empty', function() {
12461248
input('names').enter('');
12471249
expect(binding('names')).toEqual('[]');
12481250
expect(binding('myForm.namesInput.$valid')).toEqual('false');
1251+
expect(element('span.error').css('display')).not().toBe('none');
12491252
});
12501253
</doc:scenario>
12511254
</doc:example>

0 commit comments

Comments
 (0)