[英]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.