Reputation: 24600
I know how to show errors in angular js in case the all form input are invalid. I also know how to show message if one field is invalid.
The Question is how to show a message inside ng-repeat of items, when only some of the items are invalid.
<form name=form>
<div ng-repeat="item in items">
<textarea ng-model="item.value" name="item">
<div ng-show="form.name.$invalid">
I want to show this message if this textarea is invalid
</div>
</div>
<div ng-show="form.$invalid">You have error in your form</div>
</form>
Please see this above line <div ng-show="form.name.$invalid">
it will show the message x
times, but I want to show the invalid message only for the invalid input.
Upvotes: 0
Views: 190