anglejs xeditable typeahead를 사용하여 typeahead가 비어있을 때 모든 항목을 기본적으로 표시하는 방법을 설명합니다. http://vitalets.github.io/angular-xeditable/#typeaheadangular xeditable typeahead는 typeahead가 비어있을 때 기본적으로 모든 항목을 표시합니다.
0
A
답변
1
에서 xeditable 선행 입력 인 AngularJS와의
현재 예 나는 UI - 부트 스트랩 - tpls-0.10.0.js에서 일부 코드를 변경하여 작업 솔루션을 얻었다. 그래서 typeahead html 마크 업에는 차이점이 없습니다.
당신은 쿵하는 소리에서 UI - 부트 스트랩 - tpls-0.10.0.js를 사용하여이 수정 프로그램을 사용하려면 http://plnkr.co/edit/CutBFE?p=preview
을 볼 수있다. 변경 사항을 보려면 Plunk에서 ui-bootstrap-tpls-0.10.0.js를 열고 'ahneo'를 검색하십시오.
1. //minimal no of characters that needs to be entered before typeahead
kicks-in
// ahneo :: before
//var minSearch = originalScope.$eval(attrs.typeaheadMinLength) || 1;
// ahneo :: after (changed minimal no of characters to 0 by default)
var minSearch = originalScope.$eval(attrs.typeaheadMinLength) || 0;
2. // ahneo :: new (set input value to empty string if it contains " " string value)
if (inputValue === ' ') {
inputValue = '';
modelCtrl.$setViewValue('');
}
3. // ahneo :: before
//if (inputValue && inputValue.length >= minSearch) {
// ahneo :: after (add new condition to get matches for min search = 0)
if (minSearch === 0 || inputValue && inputValue.length >= minSearch) {
4. // ahneo :: new (bind element to focus event to trigger modelCtrl.$parsers.unshift method)
element.bind('focus', function (evt) {
if (modelCtrl.$viewValue === '') {
modelCtrl.$setViewValue(' ');
}
});
희망이
을하는 데 도움이