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

@@ -33,7 +33,7 @@ export const POLICY_DEFAULT_WITH_LIST = 2; // Banner2
templateUrl: './section-upload.component.html',
})
@renderSectionFor(SectionsType.Upload)
export class UploadSectionComponent extends SectionModelComponent implements OnDestroy {
export class UploadSectionComponent extends SectionModelComponent {
public AlertTypeEnum = AlertType;
public fileIndexes = [];
@@ -205,7 +205,7 @@ export class UploadSectionComponent extends SectionModelComponent implements OnD
/**
* Method provided by Angular. Invoked when the instance is destroyed.
*/
ngOnDestroy() {
onSectionDestroy() {
this.subs
.filter((subscription) => hasValue(subscription))
.forEach((subscription) => subscription.unsubscribe());