1.0.0 • Published 6 years ago

angular2-tag-autocomplete-async v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

angular2-tag-autocomplete-async

Tag input component for Angular 2

Quick Start

// In one of your application NgModules
import {RlTagInputModule} from 'angular2-tag-autocomplete-async';

@NgModule({
  imports: [
    RlTagInputModule
  ]
})
export class YourModule {}

// In one of your component templates
<rl-tag-input [(ngModel)]="tags" placeholder="Testing placeholder"></rl-tag-input>

API

Inputs

NameTypeDefaultDescription
addOnBlurbooleantrueWhether to attempt to add a tag when the input loses focus.
addOnCommabooleantrueWhether to attempt to add a tag when the user presses comma.
addOnEnterbooleantrueWhether to attempt to add a tag when the user presses enter.
addOnPastebooleantrueWhether to attempt to add a tags when the user pastes their clipboard contents.
addOnSpacebooleantrueWhether to attempt to add a tags when the user presses space.
allowDuplicatesbooleanfalseAllow duplicate tags.
allowedTagsPatternRegExp/.+/RegExp that must match for a tag to be added.
autocompletebooleanfalseToggle autocomplete mode on/off
autocompleteDebounceTimenumber0Debounce time for autocomplete
autocompleteItemsstring[][]List of suggestions for autocomplete menu if value for autocompleteItemsCallback isn't specified
autocompleteItemsCallback(term: string) => Promise<any>nullCallback for getting the suggestion list
autocompleteMaxItemsnumber10The maximum number of items that appears in the suggestions list
autocompleteMustMatchbooleantrueWhether a tag must be present in the suggestions list to be valid
autocompleteSelectFirstItembooleantruePre-highlight the first item in the suggestions list
minSearchTermLengthnumber1Min search term length for autocomplete
placeholderstring'Add a tag'Placeholder for the <input> tag.

Outputs

NameType EmittedDescription
addTagstringEmits the added tag string
removeTagstringEmits the removed tag string