Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 1.25 KB

README.md

File metadata and controls

31 lines (26 loc) · 1.25 KB

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.