From 0de89bf4a31bdc4c1087bb3f881a867c02a7802b Mon Sep 17 00:00:00 2001 From: Wouter Willems Date: Tue, 9 Jan 2024 15:00:56 +0100 Subject: [PATCH] add values for onInjected --- projects/klippa/ngx-enhancy-forms/package.json | 2 +- .../klippa/ngx-enhancy-forms/src/lib/form/form.component.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/klippa/ngx-enhancy-forms/package.json b/projects/klippa/ngx-enhancy-forms/package.json index beb3b16..afb418c 100644 --- a/projects/klippa/ngx-enhancy-forms/package.json +++ b/projects/klippa/ngx-enhancy-forms/package.json @@ -1,6 +1,6 @@ { "name": "@klippa/ngx-enhancy-forms", - "version": "14.10.3", + "version": "14.10.4", "publishConfig": { "access": "public" }, diff --git a/projects/klippa/ngx-enhancy-forms/src/lib/form/form.component.ts b/projects/klippa/ngx-enhancy-forms/src/lib/form/form.component.ts index 98d1cc4..3ca5390 100644 --- a/projects/klippa/ngx-enhancy-forms/src/lib/form/form.component.ts +++ b/projects/klippa/ngx-enhancy-forms/src/lib/form/form.component.ts @@ -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; - @Output() public onInjected = new EventEmitter(); + @Output() public onInjected = new EventEmitter>(); // we keep track of what form controls are actually rendered. Only those count when looking at form validation private activeControls: Array<{ @@ -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}`); @@ -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); } } }