import { Injectable } from '@angular/core'; import {Observable} from 'rxjs'; import {DataCardAllOfScreeningsSection} from '@nspop/gm-web-facade-api'; import {map} from 'rxjs/operators'; import {DataCardService} from '../api/data-card.service'; @Injectable({ providedIn: 'root' }) export class ScreeningsService { public screenings$: Observable<(DataCardAllOfScreeningsSection | undefined)[]> = this.dataCardService.selectedDataCard$.pipe( map((dataCard) => dataCard?.screeningsSection ? [dataCard?.screeningsSection] : []) ); constructor(private dataCardService: DataCardService) { } }