![](/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.