I am using the ngTagsInput library in my app. Setting the required keyword is not affecting form validation. Why may this be the case?
<tags-input name="tags" min-length="2" add-on-paste="true" class="bootstrap" ng-model="name" id="name" placeholder="Name" required></tags-input>
The required directive probably only works on regular text inputs. Instead, you can use the minTags attribute of ngTagsInput:
<form name="myForm">
<tags-input name="tags" min-tags="1"></tags-input>
<p ng-show="myForm.tags.$error.minTags">Tag required</p>
</form>
Then you can use the minTags validation error key instead of required error key to know if the user has entered at least one tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With