Skip to content

Commit

Permalink
get attached inputs from form element
Browse files Browse the repository at this point in the history
  • Loading branch information
wouter-willems committed Mar 1, 2024
1 parent fb8d620 commit 75dab6b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
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.16.0",
"version": "14.16.1",
"publishConfig": {
"access": "public"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ export class FormElementComponent {
return this.attachedControl;
}

public getAttachedInput(): ValueAccessorBase<any> {
return this.input;
}

public registerErrorHandler(error: string, templateRef: ElementRef): void {
this.customErrorHandlers.push({error, templateRef});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ export class FormComponent implements OnInit, OnDestroy, OnChanges {
}
}

public getFormElementByFormControl(control: UntypedFormControl): FormElementComponent {
return this.activeControls.find((e) => e.formControl === control)?.formElement;
}

trySubmit(): Promise<any> {
this.formGroup.markAllAsTouched();
const allControls: Array<UntypedFormControl> = this.getAllFormControls();
Expand Down

0 comments on commit 75dab6b

Please sign in to comment.