angular-ui/bootstrap typeahead 是否支持 ng-model-options
Does angular-ui/bootstrap typeahead support ng-model-options?
我想使用 angular-typeahead 和设置 ng-model-options="{ getterSetter: true }.据我了解,在这种情况下,typeahead应该使用ng-model的值作为getter/setter。
但实际上,typeahead覆盖了getter/setter作为模型的值。看起来提前输入不尊重ng模型选项的值。
这是我的代码
<input type="text" class="form-control"
id="elem-{$ $id $}" ng-model="value.value"
ng-model-options="{ getterSetter: true }"
typeahead="option for option in value.getOptions()">
有没有办法让提前输入尊重ng-model-options并使用getterSetter。它的功能可用吗?
据我了解,出于某些原因,预先键入会覆盖具有选定值的模型设置器。这里是木板:http://plnkr.co/edit/a3Ld9eVmysrt8RsyzbhX?p=preview
选择一两个后,您将看到"值"已更改:in 不再是一个函数。
现在angular-ui/bootstrap typeahead不支持ng-model-options,但是有一个针对0.13.1目标版本的补丁。 https://github.com/angular-ui/bootstrap/pull/3865
相关文章:
- 从 Javascript 中设置 ng-model name
- Toggle Switch在包含ng model和ng repeat之后不进行切换
- 在Angularjs中,我如何使用ng repeat、ng model和ng click来动态更改内容
- 当与之关联的 ng-model 为 false 时,Angularjs 复选框值不会取消选中
- ng-model 绑定到选择标签生成的空默认值
- 对象不能在angularjs ng-model中访问
- 为什么 HTML 中的 Value 属性在与 AngularJS 中的 ng-model 一起使用时不起作用
- ng-repeat不绑定ng-model对象数组
- AngularJS:ng-model 绑定在使用 jQuery 更改时不会更新
- 选择/选项 ng-model 未绑定 ng-selected
- Angular ng-model 将数据作为数组发送到 rails-api
- 为什么 AngularJS 在使用 ng-model 时不会在文本框上设置长度属性
- AngularJS:Ng:init-如何分配Ng:model
- 在指令中使用 ng-model 和 ng-repeat
- 使用 angularjs 访问控制器中的 ng-model 数据
- 如何在 Angularjs 中为 ng-model 增加价值
- 如何在 AngularJS 中将 ng-model 值检索到控制器
- 从角度“ng-model”选择元素中选择第一个选项,带有一个按钮
- angular-ui/bootstrap typeahead 是否支持 ng-model-options
- Ng-model不支持动态添加的html控件