I am using tagsInput Api in Angular
here is link
i want to add a tag on space. but it is not working.
here is my code
<tags-input ng-model="emails" placeholder="Add an Email" [add-on-space="true"]>
Also i want to add Email validator in tags . i have no idea.
Any idea how to do this ?
Thanks
I am using tagsInput Api in Angular
here is link
i want to add a tag on space. but it is not working.
here is my code
<tags-input ng-model="emails" placeholder="Add an Email" [add-on-space="true"]>
Also i want to add Email validator in tags . i have no idea.
Any idea how to do this ?
Thanks
Share Improve this question edited Jan 7, 2015 at 6:25 Colin Brock 21.6k9 gold badges49 silver badges62 bronze badges asked Jan 7, 2015 at 6:04 Hitu BansalHitu Bansal 3,13712 gold badges55 silver badges89 bronze badges1 Answer
Reset to default 12Try dropping the square brackets from your attribute. e.g.:
<tags-input ng-model="emails" placeholder="Add an Email" add-on-space="true">
Square brackets are just used in their documentation to indicate the ones that are optional. In its current form, your HTML isn't valid.
To validate emails, try the "allowed-tags-pattern" attribute with regex, as below:
<tags-input ng-model="emails" placeholder="Add an Email" add-on-space="true" allowed-tags-pattern="^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$">
Hope this helps.