diff --git a/src/app/services/show.service.ts b/src/app/services/show.service.ts index 76003f7..494220c 100644 --- a/src/app/services/show.service.ts +++ b/src/app/services/show.service.ts @@ -1,6 +1,6 @@ import {Injectable} from '@angular/core'; import {Show} from '../model/show'; -import {collection, collectionData, Firestore} from '@angular/fire/firestore'; +import {collection, collectionData, Firestore, orderBy, query} from '@angular/fire/firestore'; import {Observable} from 'rxjs'; @Injectable({ @@ -12,7 +12,8 @@ export class ShowService { constructor(private firestore: Firestore) { const showsRef = collection(this.firestore, this.seriesCollection); - this.shows$ = collectionData(showsRef, {idField: 'uid'}) as Observable; + const showsQuery = query(showsRef, orderBy('id')); + this.shows$ = collectionData(showsQuery, {idField: 'uid'}) as Observable; } getShows() {