This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1264,8 +1264,9 @@ var requiredDirective = function() {
1264
1264
</script>
1265
1265
<form name="myForm" ng-controller="Ctrl">
1266
1266
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">
1268
1268
Required!</span>
1269
+ <br>
1269
1270
<tt>names = {{names}}</tt><br/>
1270
1271
<tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/>
1271
1272
<tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/>
@@ -1277,12 +1278,14 @@ var requiredDirective = function() {
1277
1278
it('should initialize to model', function() {
1278
1279
expect(binding('names')).toEqual('["igor","misko","vojta"]');
1279
1280
expect(binding('myForm.namesInput.$valid')).toEqual('true');
1281
+ expect(element('span.error').css('display')).toBe('none');
1280
1282
});
1281
1283
1282
1284
it('should be invalid if empty', function() {
1283
1285
input('names').enter('');
1284
1286
expect(binding('names')).toEqual('[]');
1285
1287
expect(binding('myForm.namesInput.$valid')).toEqual('false');
1288
+ expect(element('span.error').css('display')).not().toBe('none');
1286
1289
});
1287
1290
</doc:scenario>
1288
1291
</doc:example>
You can’t perform that action at this time.
0 commit comments