File
template$
|
Default value : new Subject<TemplateRef<unknown> | undefined>()
|
|
import { TalyPageDataService } from '@allianz/taly-core';
import { DestroyRef, Injectable, TemplateRef, inject } from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { Subject } from 'rxjs';
import { skip, tap } from 'rxjs/operators';
@Injectable()
export class TalyFrameBannerService {
template$ = new Subject<TemplateRef<unknown> | undefined>();
private destroyRef = inject(DestroyRef);
constructor(talyPageDataService: TalyPageDataService) {
talyPageDataService.pageData$
.pipe(
skip(1), // skip the first as we subscribe to a behavior subject
takeUntilDestroyed(this.destroyRef),
tap(() => this.template$.next(undefined))
)
.subscribe();
}
}