Answers for "Property 'orderBy' does not exist on type 'AngularFirestoreCollection<DocumentData>"

0

Property 'orderBy' does not exist on type 'AngularFirestoreCollection<DocumentData>

this.announcementCollectionRef = afs.collection<Announcement>('announcements', ref => ref.orderBy('createdAt', 'desc'));
this.announcements = this.announcementCollectionRef.snapshotChanges().map(actions => {
    return actions.map(a => {
        const data = a.payload.doc.data() as AnnouncementId;
        const id = a.payload.doc.id;
        return { id, ...data };
    });
});
Posted by: Guest on December-19-2020

Code answers related to "Property 'orderBy' does not exist on type 'AngularFirestoreCollection<DocumentData>"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language