I am facing an issue with two radio buttons functionality. When the first radio button is selected and the user clicks a button, the display should be set to false. On the other hand, when the second radio button is chosen and the button is clicked, 'displayConflict' should be set to true.
I attempted to solve this problem using the following code but couldn't find a solution:
<input #m [checked]="model.Gender == m.value" (click)="model.Gender = m.value" name="Gender" value="male" type="radio">
<input #f [checked]="model.Gender == f.value" (click)="model.Gender = f.value" name="Gender" value="female" type="radio">
<p-button (click)="showExist(model.Gender);" pButton type="button" label="Accept"></p-button>
private display: boolean = false;
public displayConflict: boolean = false;
public showExist(str: String): void {
if (str === "male") {
this.display = false;
} else {
this.displayConflict = true;
}
}