小编Jot*_*tan的帖子

默认选中Angular 4默认单选按钮

我试图根据我从对象获得的值标记为默认的radiobutton,它可以是True或False.根据选项,我可以做什么来标记为默认的单选按钮?

<label>This rule is true if:</label>
<label class="form-check-inline">
    <input class="form-check-input" type="radio" name="mode" value="true" 
        [(ngModel)]="rule.mode"> all of the following conditions are true
</label>
<label class="form-check-inline">
    <input class="form-check-input" type="radio" name="mode" value="false"
        [(ngModel)]="rule.mode"> at least one of the following conditions is true
</label>
Run Code Online (Sandbox Code Playgroud)

我有真假rule.mode.

object radio-button angular-ng-if angular

29
推荐指数
2
解决办法
11万
查看次数

标签 统计

angular ×1

angular-ng-if ×1

object ×1

radio-button ×1