I have tested with your radio button demo example. I get
nativeElement error. Probably this.inputRef has null value at
get checked() method. So Can't read native element property. Where is my wrong?
class RadioButtonComponent extends ValueAccessorBase {
constructor() {
super(...arguments);
this.name = null;
this.disabled = false;
this.inputId = null;
}
get checked() {
return this.inputRef.nativeElement.checked;
}
writeValue(value) {
if (this.value == value) {
this.inputRef.nativeElement.checked = true;
}
}
onClickButton(event) {
this.select();
}
onChange(event) {
this.select();
}
select() {
if (this.disabled) {
return;
}
this.inputRef.nativeElement.checked = true;
this._changed.forEach(f => f(this.value));
}
}