Tags input directive for AngularJS. Check out the ngTagsInput website for more information.
- AngularJS 1.3+
- A modern browser (Chrome 31+, Firefox 29+, Safari 7+, Opera 12+, IE 10+)
All files are available from a variety of sources. Choose the one that best fits your needs:
- Direct download (https://github.com/mbenford/ngTagsInput/releases)
- NPM (
npm install ng-tags-input --save)
- Bower (
bower install ng-tags-input --save)
- CDNJS (http://cdnjs.com/libraries/ng-tags-input)
You can also grab the latest build generated by Travis. It's fully functional and may contain new features and bugfixes not yet published to the services listed above.
Now all you have to do is add the scripts to your application. Just make sure the
ng-tags-input.js file is inserted after the
- Add the
ngTagsInputmodule as a dependency in your AngularJS app;
- Add the custom element
<tags-input>to the HTML file where you want to use an input tag control and bind it to a property of your model. That property, if it exists, must be an array of objects and each object must have a property named
textcontaining the tag text;
- Set up the options that make sense to your application;
- Enable autocomplete, if you want to use it, by adding the directive
<tags-input>tag, and bind it to a function of your model. That function must return either an array of objects or a promise that eventually resolves to an array of objects (same rule from step 2 applies here);
- Customize the CSS classes, if you want to.
- You're done!
Note: There's a more detailed getting started guide on the ngTagsInput website.
Check out the documentation page for a detailed view of all available options.
You can see the directive in action in the demo page.
Before posting an issue or sending a pull request, make sure to read the CONTRIBUTING file.
See the LICENSE file.
See the CHANGELOG page.
The following are some alternatives to ngTagsInput you may want to check out:
- angular-tags: Pure AngularJS tagging widget with typeahead support courtesy of ui-bootstrap
- angular-tagger: Pure Angular autocomplete with tags, no jQuery
- jsTag: Open source project for editing tags (aka tokenizer) based on AngularJS
- bootstrap-tagsinput: jQuery plugin providing a Twitter Bootstrap user interface for managing tags (provides Angular support)