How to uncheck a radio button on its second click Angular 2+

后端 未结 2 1350
野趣味
野趣味 2021-01-25 05:10

I am trying to implement Radio button uncheck on second click in Angular 2+ as done here in angularjs. I have an array of objects that get displayed using *ngFor, therefore I ha

2条回答
  •  时光说笑
    2021-01-25 05:21

    You need to bind the radio value to an ngModel and either listen to the ngModelChange or click event instead of change.

    This answer might help you as well https://stackoverflow.com/a/42447116/4544288

提交回复
热议问题