[英]ng-repeat for chosen-select is not working
对我来说,静态选项标签可以很好地用于多选,但是如果使用ng-repeat,我不会得到选项列表,如果我删除了“选择-选择”列表,那么我就来了。 以下工作正常
in JS
var config = {
'.chosen-select' : {},
'.chosen-select-deselect' : { allow_single_deselect: true },
'.chosen-select-no-single' : { disable_search_threshold: 10 },
'.chosen-select-no-results': { no_results_text: 'Oops, nothing found!' },
'.chosen-select-rtl' : { rtl: true },
'.chosen-select-width' : { width: '95%' }
}
for (var selector in config) {
$(selector).chosen(config[selector]);
}
}
In Html
<select data-placeholder="Choose a Country..." class="chosen-select" multiple tabindex="4">
<option value="United States">United States</option>
<option value="United States">India </option>
</select>
如果我用ng-repeat替换此html代码,它将不起作用。
<select data-placeholder="Choose a Group" class="chosen-select" multiple tabindex="4">
<option ng-repeat="x in group" value="{{x.groupId}}">{{x.groupName}}</option>
</select>
我也在使用selected.jquery.js文件。
添加angular-chosen.min.js,列表(类别)为数组值
<select chosen multiple tabindex="4" class="form-control" ng-model="categoryid" ng-options="cat for cat in category" id="category" >
<option value=""></option>
</select>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.