angular-ui/bootstrap typeahead 是否支持 ng-model-options

Does angular-ui/bootstrap typeahead support ng-model-options?

本文关键字:支持 ng-model-options 是否 typeahead bootstrap angular-ui      更新时间:2023-09-26

我想使用 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