我想创建新用户时创建选择它将需要一个组。它工作得很好,但“检查”选项由于某种原因不起作用。我怎样才能使“用户”被选中,所以如果按下新建用户按钮,情况会如此呢?Angularjs无线电选择作为检查
<div class="radio-group" required>
<h3>Set user group</h3>
<label class="radio-inline">
<input type="radio" name="groupradio" value="2" ng-model="groups.group" required> Admin
</label>
<label class="radio-inline">
<input type="radio" name="groupradio" value="1" ng-model="groups.group" checked> User
</label>
<label class="radio-inline">
<input type="radio" name="groupradio" value="3" ng-model="groups.group"> Viewer
</label>
</div>
<button class="btn-sonera" ng-click="createUser(user, groups)"><i class="fa fa-floppy-o" aria-hidden="true"></i> Create user</button>
检查= “检查” –
看到这个http://stackoverflow.com/questions/23279296/radio-buttons-ng-checked-with-ng-model –
我们可能缺失一些背景。正如你可以在你的代码中看到这个运行程序(https://plnkr.co/edit/VE93DmUXIBxRYJX7mpgy?p=preview),用户复选框被选中。 – Eric