Files
wgenerator/src/app/modules/songs/services/song-list.resolver.ts
2025-01-05 10:29:29 +01:00

18 lines
435 B
TypeScript

import {Injectable} from '@angular/core';
import {Observable} from 'rxjs';
import {SongService} from './song.service';
import {Song} from './song';
import {filter} from 'rxjs/operators';
@Injectable({
providedIn: 'root',
})
export class SongListResolver {
public constructor(private songService: SongService) {}
public resolve(): Observable<Song[]> {
return this.songService.list$().pipe(filter(_ => _.length > 0));
}
}