diff --git a/libs/ui/src/lib/toggle/toggle.component.ts b/libs/ui/src/lib/toggle/toggle.component.ts index 655a841b8..15fa4e172 100644 --- a/libs/ui/src/lib/toggle/toggle.component.ts +++ b/libs/ui/src/lib/toggle/toggle.component.ts @@ -4,10 +4,9 @@ import { CommonModule } from '@angular/common'; import { ChangeDetectionStrategy, Component, - EventEmitter, Input, OnChanges, - Output + output } from '@angular/core'; import { FormControl, ReactiveFormsModule } from '@angular/forms'; import { MatRadioModule } from '@angular/material/radio'; @@ -24,10 +23,10 @@ export class GfToggleComponent implements OnChanges { @Input() isLoading: boolean; @Input() options: ToggleOption[] = []; - @Output() valueChange = new EventEmitter>(); - public optionFormControl = new FormControl(null); + protected readonly valueChange = output>(); + public ngOnChanges() { this.optionFormControl.setValue(this.defaultValue); }