Answers for "mat-radio-button checked not working"

0

mat-radio-button checked not working

/*  Use a FormControl instead 
 *
 *  <mat-radio-group [formControl]="radioFormControl">
 *      <mat-radio-button [value]="1">Option 1</mat-radio-button>
 *      <mat-radio-button [value]="2">Option 2</mat-radio-button>
 *  </mat-radio-group>
 */
@Component({})
export class RadioOverviewExample implements OnInit {
    readonly radioFormControl = new FormControl(null);

    ngOnInit() {
        this.radioFormControl.setValue(1);
    }
}
Posted by: Guest on April-08-2021

Code answers related to "mat-radio-button checked not working"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language