【发布时间】:2012-12-20 20:37:15
【问题描述】:
我正在使用 AngularUI 的 ui-select2 指令和 AJAX。
以下是我的看法:
<label>Group: <input ng-model="group" ui-select2="select2GroupConfig"></label>
这是我的模型中的内容:
$scope.select2GroupConfig = {
ajax: {
url: 'theURL',
data: function (term, page)
{
return { q: term };
},
results: function (data, page)
{
return { results: data };
}
}
};
这按预期工作。
我的问题:如何通过模型更新值?
我试过了:
$scope.group = 'some group';
我也尝试过使用对象:
$scope.group = { id: 32, text: 'some group'};
但这也不管用。
如何通过模型更新使用 AJAX 的 select2?
【问题讨论】:
标签: javascript jquery angularjs jquery-select2 angular-ui