angularjs如何默認選中radio


(1)、

使用 ng-checked 即可。

 
<label class="radio-inline"> <input name="display" type="radio" value="true" ng-model="institution.display" ng-checked="true" required> 顯示 </label> <label class="radio-inline"> <input name="display" type="radio" value="false" ng-model="institution.display"> 隱藏 </label>


(2)、

雙向綁定
雙向綁定
雙向綁定
重要的說三遍~~~

$scope.institution.display = "true";

即ng-model和value相同即可。

 

 

(https://segmentfault.com/q/1010000003712548)




免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM