简体   繁体   English

选择自动完成角度指令

[英]Select to autocomplete angular directive

I am looking for a way to make my select into an autocomplete field. 我正在寻找一种方法让我选择一个自动完成字段。 I know of angularJS directives that give you autocomplete functionality, but these don't allow the input name (what the user sees) and the input value (what the system uses) to be different. 我知道angularJS指令可以为您提供自动完成功能,但这些指令不允许输入名称(用户看到的内容)和输入值(系统使用的内容)不同。 I need a select box, however, because the option name (that the user will see) and the option value (that the system will use) are different. 但是,我需要一个选择框,因为选项名称(用户将看到)和选项值(系统将使用)是不同的。

I know of such a plugin for jQuery, selectToAutocomplete , which is pretty neat and works well, but I would prefer to stay with AngularJS as much as possible. 我知道jQuery的这个插件, selectToAutocomplete ,它非常整洁并且运行良好,但我更愿意尽可能多地使用AngularJS。 Is there an AngularJS alternative for jQuery selectToAutocomplete? 是否有针对jQuery selectToAutocomplete的AngularJS替代方案?

Angular UI ( http://angular-ui.github.io/bootstrap/ ) has a directive Typeahead which should fit your requirements. Angular UI( http://angular-ui.github.io/bootstrap/ )有一个指令Typeahead,它应该符合您的要求。 Look at that page for the 3rd example under Typeahead section with title Custom templates for results 查看Typeahead部分下第3个示例的页面,其中包含标题自定义结果模板

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM