【问题标题】:how to use offset property of ng2-tag-input component?如何使用 ng2-tag-input 组件的偏移属性?
【发布时间】:2017-06-14 08:17:19
【问题描述】:

我正在尝试使用 ng2-tag-input 设计一个自定义下拉菜单。 This 是我用作参考的链接。但是我无法为TagInputDropdownComponent 设置offset 属性。

文档中有关偏移的详细信息:

偏移量 - [?string]
用绝对值调整下拉菜单位置的偏移量(默认为'0 0')

这是我的 HTML 代码:

<tag-input-dropdown [offset]="0 0" [autocompleteObservable]='autocompleteItems$' [identifyBy]="'email'" [displayBy]="'userName'">

但我最终得到以下错误:

未处理的 Promise 拒绝:模板解析错误: 解析器错误:ng:///AppModule/UserComponent.html@2:57 中 [0 0] 的第 3 列中出现意外的令牌“0”

任何帮助将不胜感激。

【问题讨论】:

  • @Romain 的回答解决了我的问题。

标签: html angular


【解决方案1】:

来自作者:

https://github.com/Gbuomprisco/ngx-chips/issues/162

你应该这样指定:

<tag-input-dropdown [offset]="'0 0'" [autocompleteObservable]='autocompleteItems$' [identifyBy]="'email'" [displayBy]="'userName'">

【讨论】:

    猜你喜欢
    • 2017-06-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-04-30
    • 1970-01-01
    • 2011-08-31
    相关资源
    最近更新 更多