From bea1ec55920cbe1f03bf1c0cf8ad019ee3940c70 Mon Sep 17 00:00:00 2001 From: b018007 Date: Wed, 28 Aug 2024 09:53:44 +0200 Subject: [PATCH] feat(wizardPreValidation): unsubscribe added --- .../lib/src/form/form-wizard/form-wizard.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/lib/src/form/form-wizard/form-wizard.component.ts b/projects/lib/src/form/form-wizard/form-wizard.component.ts index e4d0a94..7145c08 100644 --- a/projects/lib/src/form/form-wizard/form-wizard.component.ts +++ b/projects/lib/src/form/form-wizard/form-wizard.component.ts @@ -51,7 +51,7 @@ export class FormWizardComponent implements OnInit, OnChanges, AfterContentInit, @Output() beforeNavigateForward = new EventEmitter() @Output() navigateForward = new EventEmitter() @Output() navigateBackward = new EventEmitter() - @Output() navigationFailed = new EventEmitter() + @Output() navigationFailed = new EventEmitter() @Output() submitForm = new EventEmitter() @Output() clickOnStep: EventEmitter = new EventEmitter() @@ -145,12 +145,12 @@ export class FormWizardComponent implements OnInit, OnChanges, AfterContentInit, private beforeValidateCheckValidationResultAndPerformAction(activeForm: FormGroup | undefined, formWrapper: BalFormWrapper) { if (this.beforeNavigateForwardValidation) { - this.beforeNavigateForwardValidation.subscribe( + this.subscriptions.push(this.beforeNavigateForwardValidation.subscribe( (validationResult) => validationResult.isValid ? this.checkValidationResultAndPerformAction(activeForm, formWrapper) : this.navigationFailed.emit(validationResult.errorLabel), - () => this.navigationFailed.emit(), - ) + (e) => this.navigationFailed.emit(e), + )) } else { this.checkValidationResultAndPerformAction(activeForm, formWrapper) }