After adding [(ngModel)] to a radio button group, the default [checked] no longer works

前端 未结 3 641
渐次进展
渐次进展 2020-12-05 07:16

I\'m working on a small reusable Component which styles radio buttons and emits the selected values.

import { Component, OnInit, Input, Output, EventEmitter          


        
3条回答
  •  心在旅途
    2020-12-05 07:38

    I was able to emit the value and retain the default styling with minimal changes by altering the input's template to:

    
    

    ...which I find kind of hacky. It also doesn't explain why adding data/property binding broke it, so I'm open to more suggestions.

提交回复
热议问题