Radio button for boolean property

后端 未结 1 1676
长情又很酷
长情又很酷 2021-02-03 20:06

I have a simple boolean property valid in my object document and need to bind it to radio-inputs.

This is what i have so far:



        
相关标签:
1条回答
  • 2021-02-03 20:53

    In the new forms module this might do what you want

      <input type="radio" name="food" [(ngModel)]="document.valid" [value]="true">
      <input type="radio" name="food" [(ngModel)]="document.valid" [value]="false">
    

    see also design doc for the new forms module

    0 讨论(0)
提交回复
热议问题