angular 1.3.5,angular-ui-bootstrap 0.12.0
表达式,如
typeahead="state.postcode as state.address for state in states | filter:$viewValue"不再正常工作-输入的viewValue总是用modelValue填充(在本例中是state.postcode-而不是state.address )
小提琴示例http://jsfiddle.net/s7yyv4by/
是我漏掉了什么,还是这是个bug?它可以在angular-UI0.4.0中正常工作(参见http://jsfiddle.net/dLu0oqn1/)
编辑:类似问题:Angular-UI typeahead - Working in v0.04 but not in v0.11
发布于 2014-12-06 02:51:17
你可以这样做,http://jsfiddle.net/s7yyv4by/2/
基本上将selPcode设置为整个对象。然后将postcode作为selPcode的属性进行访问。
postcode <input type="text" ng-model="selPcode.postcode" />
typeahead <input type="text" ng-model="selPcode" typeahead="state as state.address for state in states | filter:{address:$viewValue}" typeahead-editable="false" />https://stackoverflow.com/questions/27316917
复制相似问题