当选项异步加载选择指令没有选择的选择 [英] Select directive not selecting option when options are loaded asynchronously

查看:116
本文介绍了当选项异步加载选择指令没有选择的选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个<选择> 指令,其选项异步加载。 ,为存在被加载之前的选项 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆