宇筱博客

  • 解决办法
  • 学无止境
  • 记录时光
  • 百宝箱
宇筱博客
点滴记忆,汇聚成海。
  1. 首页
  2. 解决办法
  3. 正文

Angular中用$watch监视select总是会多出一个空白选项,当第一选择之后那个空白就没了

2018年1月1日 602点热度 0人点赞 0条评论

那是因为在执行 repeat 的时候 ng-model 尚未有值 ,你可以发现空白的那个option中会有一个 value="?"

给一个初始化话的值就好了

$scope.currenttype=$scope.roles[0];

原文链接:https://segmentfault.com/q/1010000003898897/a-1020000003898963

标签: 暂无
最后更新:2018年1月1日

小渔民

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

COPYRIGHT © 2025 宇筱博客. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

豫ICP备15017825号-2