Fixed issue with a subscribe when section components are destroyed

This commit is contained in:
Giuseppe
2018-10-24 14:54:31 +02:00
parent e2725086b5
commit 9eb00b9e62
4 changed files with 20 additions and 10 deletions

View File

@@ -35,7 +35,7 @@ import { difference } from '../../../shared/object.util';
templateUrl: './section-form.component.html',
})
@renderSectionFor(SectionsType.SubmissionForm)
export class FormSectionComponent extends SectionModelComponent implements OnDestroy {
export class FormSectionComponent extends SectionModelComponent {
public formId;
public formModel: DynamicFormControlModel[];
@@ -90,7 +90,7 @@ export class FormSectionComponent extends SectionModelComponent implements OnDes
});
}
ngOnDestroy() {
onSectionDestroy() {
this.subs
.filter((subscription) => hasValue(subscription))
.forEach((subscription) => subscription.unsubscribe());