![](/img/trans.png)
[英]How do I dynamically add a AngularJS typeahead component that has its own unique typeahead-on-select event?
[英]Why typeahead-on-select event firing?
我这样使用typeahead:
<input type="text"
id="UxSearchAddHoc{{$index}}"
placeholder="search"
class="form-control"
typeahead="f as f.label for f in formulaObjects | filter:$viewValue"
typeahead-on-select="selectedFormulaObject()"
style="width: calc(100% - 45px);"
ng-change="getAddHocObjects($index)"
ng-model="formulaObject" />
这是我的精选事件:
$scope.selectedFormulaObject = function () {
$timeout(function () {
console.log(5);
});
};
但是,当我从selectedFormulaObject
列表中选择一个值时,不会触发此事件。
我添加了这样的东西:
typeahead-select-on-blur="true"
及其现在的工作。 我了解到这=>当领域失去焦点时,就会发生模糊事件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.