Skip to content

mark-langer/angular2-tag-input

 
 

Repository files navigation

angular2-tag-input

Tag input component for Angular 2

Demo & Examples

View Plunker

Quick Start

npm install angular2-tag-input --save
// In one of your application components
import {TagInputComponent} from 'angular2-tag-input';

@Component({
    selector: 'your-component-selector',
    directives: [TagInputComponent] // Add to directives
    template: `<tag-input></tag-input>`
})

API

Inputs

  • ngModel : string[] - Required Property to store the resulting tag list in.
  • placeholder : string - Default: 'Add a tag' - Placeholder for the <input> tag.
  • delimiterCode : Array<number> - Default: '[188]' - Array of ASCII keycodes to split tags on. Defaults to comma.
  • addOnBlur : boolean - Default: true - Whether to attempt to add a tag when the input loses focus.
  • addOnEnter : boolean - Default: true - Whether to attempt to add a tag when the user presses enter.
  • addOnPaste : boolean - Default: true - Whether to attempt to add a tags when the user pastes their clipboard contents.
  • allowedTagsPattern : RegExp - Default: /.+/ - RegExp that must match for a tag to be added.

About

Tag input component for Angular 2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 68.7%
  • TypeScript 26.0%
  • HTML 5.3%