Angularjs 在angular js中有条件地添加ng checked属性
我想补充以下内容:Angularjs 在angular js中有条件地添加ng checked属性,angularjs,Angularjs,我想补充以下内容: <input type="radio" ng-name='{{quest.id}}' ng-model='$parent.$parent.choice.input' ng-value='{{option}}' id='{{quest.id}}-{{option.id}}' ng-required='required'> 属性:ng checked='checklast' 只有当某个条件为真时,我才能这样做。只是一个例子 <input type="r
<input type="radio" ng-name='{{quest.id}}' ng-model='$parent.$parent.choice.input' ng-value='{{option}}' id='{{quest.id}}-{{option.id}}' ng-required='required'>
属性:ng checked='checklast'
只有当某个条件为真时,我才能这样做。只是一个例子
<input type="radio" ng-checked="testModel.child_1 && testModel.child_2" ng-model="isChecked"/>
编辑
如果使用ng repeat显示收音机列表,则
<input type="radio" ng-name='{{quest.id}}' ng-model='$parent.$parent.choice.input' ng-value='{{option}}' id='{{quest.id}}-{{option.id}}' ng-required='required' ng-checked="$index == $last">
不,我的意思是我想要这样的东西:条件是什么?为什么不把条件放在ng checked
本身中呢?