角UI预输入 - 在v0.04工作,但不是在v0.11 [英] Angular-UI typeahead - Working in v0.04 but not in v0.11

查看:247
本文介绍了角UI预输入 - 在v0.04工作,但不是在v0.11的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我基本上试图在同一如本<一href=\"http://stackoverflow.com/questions/21239989/cant-use-angular-ui-bootstrap-typehead-json-with-multiple-attributes\">issue,这是解决了这个

I'm essentially trying to the same as in this issue, which was solved with this.

的目标是使用角的UI的预输入功能的模型设置为一个值,而表示在使用另一个。使用UI的引导,第三方物流企业,0.4.0.js时,该工作正常,如plunker看到。我使用的UI的引导,第三方物流企业,0.11.0.js在我所有code,所以我试图把它与合作。的问题是,事实并非如此。

The goal is to use Angular-UI's typeahead function to set the model to one value, while showing another to the use. This works fine when using ui-bootstrap-tpls-0.4.0.js, as seen in the plunker. I use ui-bootstrap-tpls-0.11.0.js in all of my other code, so I'm trying to get it working with that. The issue is that it isn't.

改为v0.11,如在本plunker看出,使其在模型和在输入显示相同。 (有也是导致它不显示可能的选项另一个错误,但是,这并不在我的情况问题)

Changing to v0.11, as seen in this plunker, causes it display the same in the model and in the input. (there's also another error that's causing it not to show the options probably, but that does not matter in my case)

这是改变预输入:

typeahead="Unidade.Codigo as Unidade.Nome for Unidade in Unidades

要:

typeahead="Unidade as Unidade.Nome for Unidade in Unidades

结果在预期的效果,作为输入显示的名称和模型具有的数据。由此可以看出这里。我的问题是,我真的很preFER的模型仅仅是Unidade.Codigo,如在第一个例子。

Results in the desired effect, as the input shows the name and the model has the data. It can be seen here. My issue is that I would really prefer for the model only to be Unidade.Codigo, as in the first example.

在我如何可以与UI的引导,第三方物流企业 - 0.11.0.js实现这个想法?

In ideas on how I can achieve this with ui-bootstrap-tpls-0.11.0.js?

编辑:更新了plunker使用AngularJS 1.2.15由@ mer10z_tech的建议。
在这里可以看到 - http://plnkr.co/edit/FHqC3HLpkmfQx7VBOGKL?p=preVIEW

Updated the plunker to use AngularJS 1.2.15 as suggested by @mer10z_tech. Can be seen here - http://plnkr.co/edit/FHqC3HLpkmfQx7VBOGKL?p=preview

推荐答案

角UI引导需要AngularJS 1.2.x版本,1.2.10与测试(的 http://angular-ui.github.io/bootstrap/

Angular UI bootstrap requires AngularJS 1.2.x, tested with 1.2.10 (http://angular-ui.github.io/bootstrap/)

如果你改变你的Plunker使用AngularJS 1.2.10它应该工作。

If you change your Plunker to use AngularJS 1.2.10 it should work.

这篇关于角UI预输入 - 在v0.04工作,但不是在v0.11的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆