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 @@ -1227,8 +1227,9 @@ var requiredDirective = function() {
1227
1227
</script>
1228
1228
<form name="myForm" ng-controller="Ctrl">
1229
1229
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">
1231
1231
Required!</span>
1232
+ <br>
1232
1233
<tt>names = {{names}}</tt><br/>
1233
1234
<tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/>
1234
1235
<tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/>
@@ -1240,12 +1241,14 @@ var requiredDirective = function() {
1240
1241
it('should initialize to model', function() {
1241
1242
expect(binding('names')).toEqual('["igor","misko","vojta"]');
1242
1243
expect(binding('myForm.namesInput.$valid')).toEqual('true');
1244
+ expect(element('span.error').css('display')).toBe('none');
1243
1245
});
1244
1246
1245
1247
it('should be invalid if empty', function() {
1246
1248
input('names').enter('');
1247
1249
expect(binding('names')).toEqual('[]');
1248
1250
expect(binding('myForm.namesInput.$valid')).toEqual('false');
1251
+ expect(element('span.error').css('display')).not().toBe('none');
1249
1252
});
1250
1253
</doc:scenario>
1251
1254
</doc:example>
You can’t perform that action at this time.
0 commit comments