import {Injectable} from '@angular/core'; import {AngularFirestore, AngularFirestoreCollection} from "@angular/fire/firestore"; import {Song} from "../models/song"; import {Observable} from "rxjs"; @Injectable({ providedIn: 'root' }) export class SongDataService { private songCollection: AngularFirestoreCollection; private songs: Observable; constructor(private afs: AngularFirestore) { this.songCollection = afs.collection('songs'); this.songs = this.songCollection.valueChanges(); } public list = (): Observable => this.songs; }