Files
wgenerator/src/app/modules/songs/services/song-list.resolver.ts
2025-01-02 15:01:59 +01:00

19 lines
438 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));
}
}