tags-autocomplete
v1.0.12
Published
TagInputAutocomplete Angular
Downloads
5
Maintainers
Readme
tags-autocomplete
Bootstrap 4 tag component to Angular.
#Usage
** (component).module.ts **
imports: [ ..., TagsAutocompleteModule, ... ]
** (component).html ** ...
<app-tags-autocomplete [tagList]="tags" (onAddItem)="addTagItem($event)" (onRemoveItem)="removeTagItem($event)">
...
** (component).component.ts ** ...
tags : any = []; constructor() { this.tags = [ {value: 'test', text: 'string test1'}, {value: 'test2', text: 'string test2'}, {value: 'test3', text: 'string test3'}, {value: 'test4', text: 'string test4'}, {value: 'test5', text: 'string test5'}, {value: 'test6', text: 'string test6'} ]; }
...
#Events callback
onAddItem() : Returns the object of added item. onRemoveItem : Returns index of removed item.
#Parameters
isRequired : if the input is required and you have to validate it. tagList : list of tags you want to put on this component.