Skip to content

Commit

Permalink
fix(module:form): fix attempt to use a destroyed error (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk authored Oct 31, 2018
1 parent f0135ce commit 3e470e7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/form/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ export class ArrayLayoutWidget extends Widget<ArrayProperty>
reset(value: any) {}

ngAfterViewInit() {
this.formProperty.errorsChanges.subscribe(() => this.cd.detectChanges());
this.formProperty.errorsChanges
.pipe(filter(() => this.ui.__destroy !== true))
.subscribe(() => this.cd.detectChanges());
}
}

Expand All @@ -93,6 +95,8 @@ export class ObjectLayoutWidget extends Widget<ObjectProperty>
reset(value: any) {}

ngAfterViewInit() {
this.formProperty.errorsChanges.subscribe(() => this.cd.detectChanges());
this.formProperty.errorsChanges
.pipe(filter(() => this.ui.__destroy !== true))
.subscribe(() => this.cd.detectChanges());
}
}

0 comments on commit 3e470e7

Please sign in to comment.