Skip to content

Commit

Permalink
AAE-28801 Make "FormRulesManager.onDestroy$" available for derived cl…
Browse files Browse the repository at this point in the history
…asses (#10441)
  • Loading branch information
BSekula authored Nov 28, 2024
1 parent bf58a19 commit 7eb51ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/core/src/lib/form/models/form-rules.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export abstract class FormRulesManager<T> {
constructor(protected formService: FormService) {}

protected formModel: FormModel;
private onDestroy$ = new Subject<boolean>();
protected onDestroy$ = new Subject<boolean>();
private initialized = false;

initialize(formModel: FormModel) {
Expand All @@ -59,14 +59,14 @@ export abstract class FormRulesManager<T> {
if (rules) {
this.formService.formRulesEvent
.pipe(
filter((event) => !!event?.form?.id && event.form.id === formModel?.id),
filter((event) => !!event?.form?.id && event.form.id === this.formModel?.id),
takeUntil(this.onDestroy$)
)
.subscribe((event) => {
this.handleRuleEvent(event, rules);
});

const onFormLoadedEvent = new FormEvent(formModel);
const onFormLoadedEvent = new FormEvent(this.formModel);
const formRules = new FormRulesEvent('formLoaded', onFormLoadedEvent);
this.formService.formRulesEvent.next(formRules);
}
Expand Down

0 comments on commit 7eb51ef

Please sign in to comment.