Zac*_*ack 2 radio-button angularjs
有没有人知道如何使用Angular JS默认检查单选按钮?我试过了
<input type= "radio" value= "point" checked= "checked"></input>
<input type= "radio" value= "range"></input>
Run Code Online (Sandbox Code Playgroud)
哪个有效,但是当我尝试添加一个小的Angular JS时
<input type= "radio" value= "point" ng-model= "mode" checked= "checked"></input>
<input type= "radio" value= "range" ng-model= "mode"></input>
Run Code Online (Sandbox Code Playgroud)
这停止了工作,即...当我加载页面时,默认情况下不再检查任何内容.有没有人知道角度确保默认情况下检查某些内容的方法?我需要检查一些东西,因为我在加载页面时显示的html最终会被选中两个单选按钮中的哪一个.
谢谢
设置ng-model等于value要检查的无线电的等于.
<input type= "radio" value= "point" ng-model= "mode"></input>
<input type= "radio" value= "range" ng-model= "mode"></input>
$scope.mode = "point";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1249 次 |
| 最近记录: |