我有一個帶有兩個函數的typeahead字段可以觸發。一個應該模糊,這是該領域的驗證。另一個應該是用戶類型,這是功能uib-typeahead
使用。輸入字段上的兩個函數調用,一個onBlur和一個不在角度上
現在我正在使用ng-model-options="{ updateOn: 'blur' }"
,但隨着用戶輸入它不會觸發預先輸入。
有沒有辦法使驗證函數觸發onBlur和typeahead觸發器正常?
例如,我調用一個指令號碼驗證,我想調用blur。然後在typeahead我想調用triggerfunction作爲用戶類型。
<input
number-validation
type="text"
maxlength="10"
class="form-control input-sm"
ng-model="number"
ng-change="number.elsewhere = null"
required
uib-typeahead="number for number in triggerfunction($viewValue)"
typeahead-template-url="/template.html"
typeahead-loading="Loadinglocations" typeahead-on-select="SelectFunction($item, 1)" typeahead-wait-ms="3"
typeahead-min-length="3">
我知道如何觸發模糊的東西。我不想在模糊上觸發兩個功能,只有一個。我已經添加了一個示例來演示/ – jenryb