我在将Select2应用到我的应用程序时遇到问题。文档很简单,但由于某种原因,我甚至无法做出多选的最简单的例子。
我创建了一个带有示例here
的plunker<div ng-controller="MyCtrl">
<select style="width: 400px;" ui-select2="select2Options" multiple ng-model="selectedTags">
<option ng-repeat="tag in tags" value="{{tag.id}}">{{tag.name}}</option>
</select>
</div>
myApp.controller('MyCtrl', function($scope) {
$scope.tags = [
{id: 0, name: "Zero"},
{id: 1, name: "One"},
{id: 2, name: "Two"},
{id: 3, name: "Three"},
{id: 4, name: "Four"},
];
$scope.select2Options = {
allowClear: true,
multiple: true
};
})