Gautam Sharma
Gautam Sharma

Reputation: 301

add tags dynamically on Tab and Spacebar event in ngx-chips

Please Anyone tell me how add tags dynamically on Tab and Spacebar event in ngx-chips.

ngx-chips

Upvotes: 1

Views: 775

Answers (1)

Nitin Lawande
Nitin Lawande

Reputation: 613

Use separatorKeyCodes (number[]) or separatorKeys (string[])

 <div class="force-to-the-bottom">
  <tag-input [ngModel]="['hardocoded-item']" [separatorKeyCodes]="[32,9]">
  <tag-input-dropdown
    [autocompleteItems]="items"
    [showDropdownIfEmpty]="true"
    [dynamicUpdate]="false">
 </tag-input-dropdown>

https://stackblitz.com/edit/ngx-chips-example-miqu3i?file=app%2Fshared%2Ftag-input%2Ftag-input.component.html

Upvotes: 1

Related Questions