簡體   English   中英

為什么要提前輸入選擇事件?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM