简体   繁体   English

按需提前更改angular-ui的行为

[英]Change behavior of angular-ui typeahead on demand

I use typeahead (by angular-ui) that has an typeahead-editable attribute which decides if typeahead should restrict model values to the ones selected from the popup only. 我使用的typeahead (由angular-ui编写)具有typeahead-editable属性,该属性确定typeahead是否应将模型值限制为仅从弹出窗口中选择的值。 I want to toggle this behavior when a $scope variable changes value. 我想在$ scope变量更改值时切换此行为。

typeahead-editable="{{ allowEdit }}"

The problem I have is that it doesn't update after it has been initialized. 我的问题是,初始化后它不会更新。

Does anyone have an idea how to achieve this? 有谁知道如何实现这一目标?

Here is the plunker ! 这是the

It works for me. 这个对我有用。 Can you create a jsfiddle? 您可以创建一个jsfiddle吗?

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

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