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

Commit de4b048

Browse files
committed
docs(ngList): fix example and add e2e test
1 parent cd11cc1 commit de4b048

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
@@ -1264,8 +1264,9 @@ var requiredDirective = function() {
12641264
</script>
12651265
<form name="myForm" ng-controller="Ctrl">
12661266
List: <input name="namesInput" ng-model="names" ng-list required>
1267-
<span class="error" ng-show="myForm.list.$error.required">
1267+
<span class="error" ng-show="myForm.namesInput.$error.required">
12681268
Required!</span>
1269+
<br>
12691270
<tt>names = {{names}}</tt><br/>
12701271
<tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/>
12711272
<tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/>
@@ -1277,12 +1278,14 @@ var requiredDirective = function() {
12771278
it('should initialize to model', function() {
12781279
expect(binding('names')).toEqual('["igor","misko","vojta"]');
12791280
expect(binding('myForm.namesInput.$valid')).toEqual('true');
1281+
expect(element('span.error').css('display')).toBe('none');
12801282
});
12811283
12821284
it('should be invalid if empty', function() {
12831285
input('names').enter('');
12841286
expect(binding('names')).toEqual('[]');
12851287
expect(binding('myForm.namesInput.$valid')).toEqual('false');
1288+
expect(element('span.error').css('display')).not().toBe('none');
12861289
});
12871290
</doc:scenario>
12881291
</doc:example>

0 commit comments

Comments
 (0)