I have a set of three radio buttons which are three form controls of a form group in Angular 4. I want only one of them to be selected at a time for which I have to give three of them a common name but while doing so I get an error saying:
Error: If you define both a name and a formControlName attribute on your radio button, their values must match.
<html>
<form [formGroup]="myGroup">
<input type="radio" formControlName="food" name="food">
<input …Run Code Online (Sandbox Code Playgroud)