Answers for "mat radio button checked programmatically"

CSS
0

mat radio button color

::ng-deep .mat-radio-button.mat-accent .mat-radio-ripple .mat-ripple-element {
	opacity: 0.5 !important;     /*click effect color change*/
	background-color: blue !important;
}

::ng-deep .mat-radio-button.mat-accent .mat-radio-inner-circle {
	background-color: blue!important;   /*inner circle color change*/
}

::ng-deep.mat-radio-button.mat-accent.mat-radio-checked .mat-radio-outer-circle {
	border-color:blue!important; /*outer ring color change*/
}
Posted by: Guest on January-29-2021
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

Browse Popular Code Answers by Language