解决设置select默认选中不生效的方法
$scope.storageTypeList = ['Glusterfs','NFS','Ceph'];
不生效的方法:
<select class="form-control" name="type" ng-disabled="editStorage.usage !== null" required
data-ng-model="storageVO.type">
<option value="{{storageType}}" data-ng-repeat="storageType in storageTypeList">{{storageType}}</option>
</select>
$scope.storageVO.type ='NFS';
生效的方法
<select class="form-control" name="type" ng-disabled="editStorage.usage !== null" required
data-ng-model="storageVO.type">
<option value="{{storageType}}" ng-selected="storageType === storageVO.type"
data-ng-repeat="storageType in storageTypeList">{{storageType}}</option>
</select>
$scope.storageVO.type ='NFS';
主要是紫色字体部分产生的作用
解决设置select默认选中不生效的方法的更多相关文章
- jQuery 设置select默认选中问题
在进行其他操作后,恢复select默认选中 html代码: <select id="shai" style="width:150px;margin:5px 50px ...
- 用jQuery的attr()设置option默认选中无效的解决 attr设置属性失效
表单下拉选项使用selected设置,发现第一次默认选中成功,在页面不刷新的情况下,再次下拉,selected属性设置了,默认选中不生效 在手机端有些浏览器用jQuery的attr()方法设置sele ...
- jQuery 根据value设置radio默认选中
jQuery 根据value设置radio默认选中:HTML: <input type="radio" name="type" value="1 ...
- struts2设置<s:select>默认选中项的方法
struts2的select标签中,常用的有以下几个属性:(1)struts2中的select 标签中,必须设置的属性只有一个,即是list.(2)select标签的list中必须有值,不然会报错.如 ...
- struts2 select 默认选中
jsp: <s:select list="#{'1':'男','2':'女'}" name="sex"/> action: private Stri ...
- 设置select默认值
W3C下设置一个默认值直接为 select.value='默认值'. IE8下设置默认值必须有这个option才能被设置,不像W3C 如chrome这种,直接设置就能显示,如果IE下这样设置的话sel ...
- js获取select默认选中的Option (非当前选中值)
js函数方法: <script> function getDefaultSelectedOption(selectId, valIfNull) { var selectId = selec ...
- 关于ligerUi的ligertree的初始化默认选中指定项目的方法
LigerUi中ligerTree官方示例代码片段: var parm = function (data) { return data.text.indexOf('节点1.3') == 0; }; t ...
- radio,checkbox,select,input text获取值,设置哪个默认选中
11 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title& ...
随机推荐
- POJ 2230 Watchcow(有向图欧拉回路)
Bessie's been appointed the new watch-cow for the farm. Every night, it's her job to walk across the ...
- ABAP空格和零的问题
空格 concatenate wa_detail-zz_mark1 '' '' '' wa_detail-kdmat1 into wa_detail-zz_mark1 separated by spa ...
- [BX]指令
mov ax,[bx] 功能:bx中存放的数据作为一个偏移地址EA,段地址SA默认在ds中,将SA:EA处的数据送入ax中.即(ax)=((ds)*16+(bx)). mov [bx],ax 功能:b ...
- NuGet打包,IIS自动发布
NuGet学习笔记(1)——初识NuGet及快速安装使用 https://kb.cnblogs.com/page/143190/ NuGet学习笔记(2)——使用图形化界面打包自己的类库 https: ...
- better-scroll使用总结
参考:https://zhuanlan.zhihu.com/p/27407024 better-scroll使用小结 核心就是这4个 <script> import BScroll fro ...
- 集合 day8
一,集合. 集合是无序的,不重复的数据集合,它里面的元素是可哈希的(不可变类型),但是集合本身是不可哈希(所以集合做不了字典的键)的.以下是集合最重要的两点: 去重,把一个列表变成集合,就自动去重了. ...
- 面试题集锦;有关作用域和this的指向
作用域面试题: 1. fn() function fn () { console.log(12) } var as = function () { console.log(45) } 2. var a ...
- c#dev tabcontrol 切换页面时注意的问题
先加一个代码 public void SetXtraTabPageVisible(DevExpress.XtraTab.XtraTabControl xtraTabControl, bool iIsV ...
- yum 安装 php7 ,lamp ,以及安装swoole
1 更新yum yum update 2 安装依赖 yum -y install pcre* openssl* yum -y install gcc make gd-devel libjpeg-dev ...
- C#程序如何以管理员身份运行
VISTA 和 Windows 7 都使用了UAC来控制程序访问,对于一些需要使用管理员身份运行的程序就得右键以管理员身份运行. C# 编程中可以使程序自动使用管理员身份运行,也就是我们常常看到一些程 ...