当选项异步加载选择指令没有选择的选择 [英] Select directive not selecting option when options are loaded asynchronously
问题描述
我有一个<选择>
指令,其选项异步加载。 ,为存在被加载之前的选项 NG-模型
属性点的变量。但是,未选中的选项都加载后正确的选项。相反,选择变为空白。我创建了一个普拉克来演示此行为: http://plnkr.co/edit/KNunC6 。
I have a <select>
directive whose options are loaded asynchronously. The variable that the ng-model
attribute points to exists prior to the options being loaded. However, after the options are loaded the correct option is not selected. Instead, the select becomes blank. I've created a plunk to demonstrate this behaviour: http://plnkr.co/edit/KNunC6.
推荐答案
的 https://github.com/angular/angular.js/issues/9714#ref-pullrequest-53337829
好像这是一个角度的核心错误。你会使用 NG-重复
并获得更大的成功 NG-检查
我猜。
seems like this is an angular core bug. you'd be more successful using ng-repeat
and ng-checked
I guess.
这篇关于当选项异步加载选择指令没有选择的选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!