小编use*_*766的帖子

Angular radio button

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)

radio-button angular

4
推荐指数
1
解决办法
9915
查看次数

标签 统计

angular ×1

radio-button ×1