over 1 year ago
i'm not able to fetch data from firebase on mat table
from component ts
getAllStudent() { this.service.getAllStudent().subscribe((data: any)=>{ console.log(data.payload) this.students = data.map((e: { payload: { doc: { id: any; data: () => any; }; }; }) => { return { $key:e.payload.doc.id, ...e.payload.doc.data() }as Student; }); console.log(this.students); this.studentData = new MatTableDataSource(this.students) this.studentData.paginator = this.paginator; }); }
this form service
getAllStudent() { let userid : any = ''; userid = window.localStorage.getItem("userid") console.log(userid) return this.firestore.collection('School').doc(userid).snapshotChanges(); }
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Answer(s)