在我的应用程序中,我使用 jQuery 1.7(不要问为什么:( )与 angularjs 1.2.5 和 select2。我使用 ui-select2 来将 select2 与 angularjs 集成。
更新到最新版本的 ui-select2 后,插件停止选择值...问题似乎是由指令添加的 priority: 1
选项来添加对 angularjs 1.2.x 的支持this commit .
演示:Plunker
有人遇到过这个问题吗?
脚本
var app = angular.module('my-app', ['ui.select2'], function () {
})
app.controller('AppController', function ($scope) {
$scope.transition = {};
var results = [{
id: '1',
text: 'One',
type: 1
}, {
id: '2',
text: 'Two',
type: 1
}, {
id: '3',
text: 'Three',
type: 1
}, {
id: '4',
text: 'Fout',
type: 1
}]
$scope.select2Options = {
id: 'id',
data: results,
multiple: true
}
})
HTML:
<body ng-controller="AppController">
<input class="trans-values" ui-select2="select2Options" ng-model="transition.value" style="width: 150px" multiple />
</body>
最佳答案
关于jquery - ui-select2(multiple) 与 jquery 1.7.x 不选择值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20701692/