angularjs中,只显示选中的radio的值。主要是相同的radio,name属性值要相同还有ng-model的值要相同,同时要指定value值。这样选中的时候就会在下面的div中显示选中的值了。
/*文件引用等省略*/
<div class="showType">
<input type="radio" name="showLine" ng-model="line" value="oneLine" /> <label for="oneLine">显示一列</label> <input type="radio" name="showLine" ng-model="line" value="twoLine"/> <label for="twoLine">显示两列</label> <input type="radio" name="showType" ng-model="type" value="allOver"/> <label for="allOver">全屏展示</label> <input type="radio" name="showType" ng-model="type" value="smallOver"/> <label for="smallOver">还原窗口</label>
</div>
<div>
{{line}}{{type}}
</div>
原文:http://www.cnblogs.com/xueyuting/p/6255640.html