【发布时间】:2017-09-11 13:39:55
【问题描述】:
我有一个这样的标签输入字段:
<tags-input class="bootstrap"
ng-model="tags"
placeholder="Voeg een tag toe"
replace-spaces-with-dashes="false"
add-from-autocomplete-only="false">
<auto-complete source="loadTags($query)"
min-length="0"
debounce-delay="0"
load-on-focus="true"
load-on-empty="true"
selectFirstMatch="false"
max-results="10"></auto-complete>
</tags-input>
这是加载标签:
$scope.loadTags = function(query) {
return [
'Productie',
'Gevelreclame',
'Studio',
'Freesletters',
'Online',
'Peter',
'Gerroy',
'Robert'
];
};
但是当我键入添加标签时,我按回车键添加它会添加从自动完成中选择的标签,而不是我输入的值。但是当我点击输入时,它会添加带有我输入的值的标签。但我希望这也可以与输入一起使用。这个我想不通。
希望你能帮忙!
【问题讨论】:
标签: angularjs angularjs-directive ng-tags-input