From ae74e61e2047c23fe3874e892e423db500420954 Mon Sep 17 00:00:00 2001 From: Phan Huy Tran Date: Wed, 20 Nov 2024 12:48:42 +0100 Subject: [PATCH] Done --- src/app/services/show.service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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() {