Browse Source

feat(lib): implement output signal for valueChange

pull/6533/head
KenTandrian 3 weeks ago
parent
commit
11c9256817
  1. 7
      libs/ui/src/lib/toggle/toggle.component.ts

7
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<Pick<ToggleOption, 'value'>>();
public optionFormControl = new FormControl<string | null>(null);
protected readonly valueChange = output<Pick<ToggleOption, 'value'>>();
public ngOnChanges() {
this.optionFormControl.setValue(this.defaultValue);
}

Loading…
Cancel
Save