2015-12-21 64 views
0

我試圖在引導選擇組合框中顯示標籤。但是,ng-repeat沒有填充選項。經過一番調查後,我相信我需要爲此寫一條指令,因爲Bootstrap會在Angular添加選項之前採用這些選項並列出它們。但我不知道編寫指令涉及什麼。引導選擇組合框和ngRepeat選項不起作用

<select class="combobox form-control" ng-model = "tags.repeatSelect"> 
<option ng-repeat = "tag in tags.tagNames" value = "{{tag.string}}"> {{tag.string}} </option> 

回答

0

這可能會解決你的問題。

<select data-ng-model="modelValue" class="form-control" data-ng-options="item.string for item in tags.tagNames"> 
</select>