我试图使用ui-select2 2角指令,github回购声明:
所有select2选项都可以通过指令传递。您可以在Select2文档页上更多地了解所支持的选项列表及其所做的工作。
我有指令工作,但无法传递简单的选项(即:它们被忽略)。例如:
html
<form>
<input type='hidden' ui-select2='selectGenes' ng-model='selectedGene' , ng-required="true">
</form>js
$scope.selectGenes = {
minimumInputLength: 2,
'ajax': {
url: "/api/genes.json",
dataType: 'json',
data: function(term, page) {
return { q: term };
},
results: function(data, page) {
var index;
for (index = 0; index < data.length; ++index){
data[index].text = data[index].name2;
};
return { results: data };
}
}
}; 发布于 2014-03-16 09:08:01
我算出来了。需要引用Select2 parms。
$scope.selectGenes = {
'minimumInputLength': 2,
'placeholder': 'Enter Gene',https://stackoverflow.com/questions/22434931
复制相似问题