2017-03-03 257 views
4

這是我的角碼我要設置默認值300MB如何設置默認值MD-選擇

<label >RAM</label> 
    <md-select ng-model="RAMVal"> 
    <md-option value="300mb" ng-selected="index == 1">300mb</md-option> 
    <md-option value="400mb">400mb</md-option> 
    </md-select> 
+0

請參閱此鏈接[md-select-cant-set-selected-value](http://stackoverflow.com/questions/31881754/md-select-cant-set-selected-value) – Gaurav

回答

-1

只需將ngModel(RAMVal)值設置爲默認選擇的選項即可。例如:$ scope.RAMVal ='300mb'; 參考鏈接:mdSelect