0
Hello, I have a problem at Angular. I want my Angular Material button select to be unchecked (uncheck) when the following function is called, but I have no idea how to do it, can anyone help me. I’ll put the codes down here.
Code of the function
uncheckRadio(){
alert('Botao desmarcado')
}
Code for my Radio Button:
<div class="form-group col-md6 form-md-checkboxes">
<label>Instância</label>
<mat-radio-group (change)="radioChange($event)" formControlName="status">
<mat-radio-button color="primary" value="primeira">Primeira Instancia</mat-radio-button>
<mat-radio-button color="primary" value="segunda">Segunda Instancia</mat-radio-button>
</mat-radio-group>
</div>
I have the following error: [ts] Property 'formGroup' does not exist on type 'Querysearchdccomponent'.
– Marcelo Henrique Dos Reis
The this formGroup is nothing more than a variable of the type Formgroup that I created in the archive .ts. I did so because I saw in your example code the formControlName="status" so I figured you’re using Reactiveforms in your development. Simply replace the this formGroup for the variable of your Formgroup. Anyway I leave it here in this link the complete example of my code.
– Cristiano de Souza Vinhal