加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – Angular UI Bootstrap typeahead-append-to

发布时间:2020-12-17 17:39:32 所属栏目:安全 来源:网络整理
导读:我正在尝试将Angular UI Typeahead控件附加到 HTML中的自定义元素.文档说明了这一点: typeahead-append-to $(Default: null) – Should the typeahead popup be appended to an element instead of the parent element? 我不能为我的生活图什么设置这个值!
我正在尝试将Angular UI Typeahead控件附加到 HTML中的自定义元素.文档说明了这一点:

typeahead-append-to $(Default: null) – Should the typeahead popup be appended to an element instead of the parent element?

我不能为我的生活图什么设置这个值!我已经尝试了’#elementId’和’.elementClass’的所有组合,但仍然没有运气.

我可以向身体附加没有类型为appea-append-to-body =“true”的probs,但这不是我想要做的.

请帮忙!

干杯

解决方法

过时看最新方法的编辑部分

typeahead-append-to属性要求您引用控制器中的元素并绑定到该元素:

$scope.appendToElement = window.document.querySelector('body');

<input uib-typeahead="val for val in vals" typeahead-append-to="appendToElement" />

可以看到typeahead指令中读取属性并附加元素的代码为here

编辑

该指令已更新,将接受一个选择器字符串,如下所示:

<input uib-typeahead="val for val in vals" typeahead-append-to="'#appendToElement'" />

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读