我正在使用 Angular UI-bootstrap typeahead。
我有 HTML
<input type="text"
ng-init="selectedCrossFormFieldText = selectedCrossFormFieldText || {}"
ng-model="selectedCrossFormFieldText[fieldId]"
placeholder="Auto-complete data from field of form"
empty-typeahead
ng-trim="false"
typeahead="crossFormField.id as crossFormField for crossFormField in getCrossFormFieldData(fieldId, $viewValue) | filter:$viewValue:optionComparator"
typeahead-template-url="views/blocks/cross_form_data_typeahead.html"
typeahead-on-select="addCrossFormField(fieldId, $item, $model, $label)"
typeahead-loading="loadingCrossFormField[fieldId]"
typeahead-min-length="0" class="form-control" />
和
脚本:
.then(function (response) {
console.log('DataForTypeahead', response);
return response.data;
});
当我键入时,它会在 typeahead-popup 中显示匹配的选项。但是,当没有匹配项时,我应该怎么做才能在同一个弹出窗口“未找到匹配项”上显示?