【问题标题】:add tags dynamically on Tab and Spacebar event in ngx-chips在 ngx-chips 中的 Tab 和 Spacebar 事件上动态添加标签
【发布时间】:2020-07-15 12:37:53
【问题描述】:

请任何人告诉我如何在 ngx-chips 中的 Tab 和 Spacebar 事件上动态添加标签。

【问题讨论】:

    标签: angular ngx-chips


    【解决方案1】:

    使用 separatorKeyCodes (number[]) 或 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

    【讨论】:

      猜你喜欢
      • 2020-09-02
      • 2019-04-14
      • 2020-01-14
      • 1970-01-01
      • 1970-01-01
      • 2020-02-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多