Browse Source

fix(lib): type errors

pull/6533/head
KenTandrian 3 weeks ago
parent
commit
9070857b38
  1. 8
      libs/ui/src/lib/toggle/toggle.component.ts

8
libs/ui/src/lib/toggle/toggle.component.ts

@ -26,13 +26,17 @@ export class GfToggleComponent implements OnChanges {
@Output() valueChange = new EventEmitter<Pick<ToggleOption, 'value'>>();
public optionFormControl = new FormControl<string>(undefined);
public optionFormControl = new FormControl<string | null>(null);
public ngOnChanges() {
this.optionFormControl.setValue(this.defaultValue);
}
public onValueChange() {
this.valueChange.emit({ value: this.optionFormControl.value });
const value = this.optionFormControl.value;
if (value !== null) {
this.valueChange.emit({ value });
}
}
}

Loading…
Cancel
Save