我正在使用bootstrap-multiselect控件。一旦所有選項都被Angular填充,我需要在select元素上執行multiselect()。Angular綁定/使用ng-options填充下拉列表後的火災事件
這裏是選擇框,綁定到$ scope屬性,從accountInfo對象數組所產生的選項從我的觀點片段:
<select id="property" multiple="multiple"
ng-model="selectedProperty"
ng-options="account.property_name group by account.client_name for account in accountInfo">
</select>
所以一旦選項存在,我需要調用$ (「#property」)。multiselect()來生成引導控件,但我正在尋找一個事件來監聽它,告訴我何時生成了所有選項。
[ng-repeat finish event]的可能重複(http://stackoverflow.com/questions/13471129/ng-repeat-finish-event) –
您應該使用指令代替它。另外,你確定''select multiple =「multiple」>'與'ng-model'和'ng-options'一起工作嗎?我可以發誓我遇到過去的問題 – mhodges
只要模型是一個數組,ng-model就可以選擇多重模式 - 將如何構造指令以確定何時寫入最後一個選項? – DShultz