【发布时间】:2014-12-01 10:27:30
【问题描述】:
为什么我无法使用 ng-change 函数正确获取选定的预输入值?
这是我的代码
<input
type="text"
ng-model="asyncSelected"
placeholder="Locations loaded via $http"
typeahead="address for address in getLocation($viewValue)"
typeahead-loading="loadingLocations"
class="form-control"
ng-change="change(asyncSelected)">
问题是变量 asyncSelected 总是返回我输入的字符串,而不是通过预先输入选择的字符串。这是向您展示问题的 plunkr,只需输入即可。我从 angular-ui-bootstrap 的官方文档中分叉它
【问题讨论】:
标签: javascript angularjs twitter-bootstrap angular-ui-bootstrap