我想在下拉菜单中设置标签。就像我想要自定义电子邮件或其他任何东西,它应该显示为标记。 我正在分享jsfiddle。
<div ng-controller="MyCtrl">
<label>Please select items:</label>
<select ui-select2 multiple ng-model='selectedDaltons'>
<option ng-repeat="d in daltons" ng-bind="d" value="{{ d }}"></option>
</select>
</div>
var myApp = angular.module('myApp', ['ui.select2']);
function MyCtrl($scope) {
$scope.daltons = [
'Joe',
'William' ,
'Jack' ,
'Averell' ,
'Ma'
];
$scope.selectedDaltons = 'joe'; // Averell is preselected
};
答案 0 :(得分:2)
在ui-select中,您可以使用&#39;标记&#39;功能,你甚至可以设置标签标签。 看看这个链接
https://github.com/angular-ui/ui-select/wiki/ui-select
这个掠夺者:
http://plnkr.co/edit/m1SQXUxftBLQtitng1f0