|
|
@ -31,17 +31,17 @@ export class ToggleComponent implements OnChanges, OnInit { |
|
|
|
|
|
|
|
@Output() change = new EventEmitter<Pick<ToggleOption, 'value'>>(); |
|
|
|
|
|
|
|
public option = new FormControl<string>(undefined); |
|
|
|
public optionFormControl = new FormControl<string>(undefined); |
|
|
|
|
|
|
|
public constructor() {} |
|
|
|
|
|
|
|
public ngOnInit() {} |
|
|
|
|
|
|
|
public ngOnChanges() { |
|
|
|
this.option.setValue(this.defaultValue); |
|
|
|
this.optionFormControl.setValue(this.defaultValue); |
|
|
|
} |
|
|
|
|
|
|
|
public onValueChange() { |
|
|
|
this.change.emit({ value: this.option.value }); |
|
|
|
this.change.emit({ value: this.optionFormControl.value }); |
|
|
|
} |
|
|
|
} |
|
|
|