Answer the question
In order to leave comments, you need to log in
How to mark radio button as default in angular 8?
There are two radio buttons on the page, you need to mark one of them by default, tried various checked and checked="true" attributes, but unfortunately nothing works. I found options on Google, but they seem to be suitable only for angularJS or angular 2 ... and I use angular 8.
Here is the code itself in test.component.html:
<div class="form-check" >
<mat-radio-button type="radio" class="form-check-input" id="materialUnchecked" name="filterType" value="0" [(ngModel)]="filterType" [checked]="true">By client</mat-radio-button>
<mat-radio-button type="radio" class="form-check-input" id="materialChecked" name="filterType" value="1" [(ngModel)]="filterType">By student</mat-radio-button>
<br><br>
</div>
protected filterType;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question