$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默认选中不生效的方法的更多相关文章

  1. jQuery 设置select默认选中问题

    在进行其他操作后,恢复select默认选中 html代码: <select id="shai" style="width:150px;margin:5px 50px ...

  2. 用jQuery的attr()设置option默认选中无效的解决 attr设置属性失效

    表单下拉选项使用selected设置,发现第一次默认选中成功,在页面不刷新的情况下,再次下拉,selected属性设置了,默认选中不生效 在手机端有些浏览器用jQuery的attr()方法设置sele ...

  3. jQuery 根据value设置radio默认选中

    jQuery 根据value设置radio默认选中:HTML: <input type="radio" name="type" value="1 ...

  4. struts2设置<s:select>默认选中项的方法

    struts2的select标签中,常用的有以下几个属性:(1)struts2中的select 标签中,必须设置的属性只有一个,即是list.(2)select标签的list中必须有值,不然会报错.如 ...

  5. struts2 select 默认选中

    jsp: <s:select list="#{'1':'男','2':'女'}" name="sex"/> action: private Stri ...

  6. 设置select默认值

    W3C下设置一个默认值直接为 select.value='默认值'. IE8下设置默认值必须有这个option才能被设置,不像W3C 如chrome这种,直接设置就能显示,如果IE下这样设置的话sel ...

  7. js获取select默认选中的Option (非当前选中值)

    js函数方法: <script> function getDefaultSelectedOption(selectId, valIfNull) { var selectId = selec ...

  8. 关于ligerUi的ligertree的初始化默认选中指定项目的方法

    LigerUi中ligerTree官方示例代码片段: var parm = function (data) { return data.text.indexOf('节点1.3') == 0; }; t ...

  9. radio,checkbox,select,input text获取值,设置哪个默认选中

    11 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title& ...

随机推荐

  1. iOS-引用计数与ARC(转)

    以下是关于内存管理的学习笔记:引用计数与ARC. iOS5以前自动引用计数(ARC)是在MacOS X 10.7与iOS 5中引入一项新技术,用于代替之前的手工引用计数MRC(Manual Refer ...

  2. 893. Groups of Special-Equivalent Strings 奇数偶数位上的相同数

    [抄题]: You are given an array A of strings. Two strings S and T are special-equivalent if after any n ...

  3. JNI开发篇——报错:Flag android.useDeprecatedNdk is no longer supported and will be removed in the next……

    大概意思就是说: android.useDeprecatedNdk不再支持了 让使用CMake or ndk-build 然后还有链接 解决方法: 1.先通过SDKManager下载:CMake和LL ...

  4. MapperScannerConfigurer 自动扫描 将Mapper接口生成代理注入到Spring

    Mybatis在与Spring集成的时候可以配置 MapperFactoryBean来生成Mapper接口的代理. 例如 <bean id="userMapper" clas ...

  5. "cni0" already has an IP address different from 10.244.2.1/24。 Error while adding to cni network: failed to allocate for range 0: no IP addresses available in range set: 10.244.2.1-10.244.2.254

    "cni0" already has an IP address different from 10.244.2.1/24. Error while adding to cni n ...

  6. 1N - 计算球体积

    根据输入的半径值,计算球的体积. Input 输入数据有多组,每组占一行,每行包括一个实数,表示球的半径. Output 输出对应的球的体积,对于每组输入数据,输出一行,计算结果保留三位小数. Sam ...

  7. Iperf使用方法与参数说明

      Iperf使用方法与参数说明 http://pkgs.repoforge.org/iperf/ Iperf是一个网络性能测试工具.可以测试TCP和UDP带宽质量,可以测量最大TCP带宽,具有多种参 ...

  8. (O)web缓存

    为什么要用缓存 一般针对静态资源如CSS,JS,图片等使用缓存,原因如下: 请求更快:通过将内容缓存在本地浏览器或距离最近的缓存服务器(如CDN),在不影响网站交互的前提下可以大大加快网站加载速度. ...

  9. 异步Servlet和异步过虑器

    异步处理功能可以节约容器线程.此功能的作用是释放正在等待完成的线程,是该线程能够被另一请求所使用. 要编写支持异步处理的 Servlet 或者过虑器,需要设置 asyncSupported 属性为 t ...

  10. [Python] Python教程

    http://www.runoob.com/python/python-tutorial.html