Skip to content

Commit

Permalink
add values for onInjected
Browse files Browse the repository at this point in the history
  • Loading branch information
wouter-willems committed Jan 9, 2024
1 parent 6b25358 commit 0de89bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion projects/klippa/ngx-enhancy-forms/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@klippa/ngx-enhancy-forms",
"version": "14.10.3",
"version": "14.10.4",
"publishConfig": {
"access": "public"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class FormComponent implements OnInit, OnDestroy, OnChanges {
@Input() public errorMessageLocation: 'belowCaption' | 'rightOfCaption' = 'belowCaption';
@Input() public formGroup: UntypedFormGroup;
@Input() public patchValueInterceptor: (values: any) => Promise<any>;
@Output() public onInjected = new EventEmitter<void>();
@Output() public onInjected = new EventEmitter<Record<string, any>>();

// we keep track of what form controls are actually rendered. Only those count when looking at form validation
private activeControls: Array<{
Expand Down Expand Up @@ -67,7 +67,7 @@ export class FormComponent implements OnInit, OnDestroy, OnChanges {
this.formGroup.patchValue(valueBeforeInject);
}
injectInto.setControl(injectAt, this.formGroup);
this.onInjected.emit();
this.onInjected.emit(valueBeforeInject);
} else if (injectInto instanceof UntypedFormGroup) {
if (typeof injectAt !== 'string') {
throw new Error(`cannot index FormGroup with ${typeof injectAt}`);
Expand All @@ -80,7 +80,7 @@ export class FormComponent implements OnInit, OnDestroy, OnChanges {
this.formGroup.patchValue(valueBeforeInject);
}
injectInto.setControl(injectAt, this.formGroup);
this.onInjected.emit();
this.onInjected.emit(valueBeforeInject);
}
}
}
Expand Down

0 comments on commit 0de89bf

Please sign in to comment.