diff --git a/npm/ng-packs/packages/components/page/src/page-part.directive.ts b/npm/ng-packs/packages/components/page/src/page-part.directive.ts index 74ad59c26c..3e59b7aee2 100644 --- a/npm/ng-packs/packages/components/page/src/page-part.directive.ts +++ b/npm/ng-packs/packages/components/page/src/page-part.directive.ts @@ -18,7 +18,7 @@ import { Observable, Subscription, of } from 'rxjs'; export interface PageRenderStrategy { shouldRender(type?: string): boolean | Observable; onInit?(type?: string, injector?: Injector, context?: any): void; - onDestroy?(type: string, injector?: Injector, context?: any): void; + onDestroy?(type?: string, injector?: Injector, context?: any): void; onContextUpdate?(change?: SimpleChange): void; } @@ -84,7 +84,7 @@ export class PagePartDirective implements OnInit, OnDestroy, OnChanges { protected createRenderStream(type: string) { this.clearSubscription(); - this.shouldRender(type).subscribe(this.render); + this.subscription = this.shouldRender(type).subscribe(this.render); } protected clearSubscription() {