Parent component call
<x-radio [(M)]="sex" value="male">男</x-radio>
<x-radio [(M)]="sex" value="female">女</x-radio>
Subcomponent
<input type="radio" [ngModel]="M" (ngModelChange)="MChange.emit(value)" [attr.value]="value">
Writing like this now doesn’t work at all. If you don’t use subcomponents, there is no problem, but you need to encapsulate the style of the control. Please help - -
There is no problem with data changes in this writing method, but the selection effect will not be achieved.
Solved, around the corner.