Thanks for the tutorial, just had to add a pipe around the map…

this.tasks = this.db.collection(config.collection_endpoint).snapshotChanges().pipe(map(actions => {return actions.map(a => {//Get document dataconst data = a.payload.doc.data() as Task;//Get document idconst id = a.payload.doc.id;//Use spread operator to add the id to the document datareturn { id, …data };});})); 
Daniel Carneiro
Daniel Carneiro

Written by Daniel Carneiro

UI/UX Designer & Front End Developer @CADS Software LTD UK, https://github.com/loonix

Responses (1)