<label class="radio-inline">
<input name="display" type="radio" value="true" ng-model="institution.display" checked required>显示
</label>
<label class="radio-inline">
<input name="display" type="radio" value="false" ng-model="institution.display">隐藏</label>
angularjs如何默认选中第一个
Just use
ng-checked
.Set the value of
institution.display to the corresponding
checked = "checked"
Just add the ng-model binding element at the same time
Two-way binding
Two-way binding
Two-way binding
It’s important to say it three times~~~
$scope.institution.display = "true";
That is, ng-model and value can be the same.
can be found in
ng-repeat
中使用ng-checked
, in the form: