Guest User

Untitled

a guest
Dec 10th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. return this.afs.collection("events").snapshotChanges().pipe(
  2. map(eventSnapshots => {
  3. return eventSnapshots.reduce((eventsArray: EventInterface[], eventSnapshot) => {
  4. eventsArray.push(EventImporterJSON.getEventFromJSON(<EventJSONInterface>eventSnapshot.payload.doc.data()));
  5. return eventsArray;
  6. }, []);
  7. }),
  8. );
  9.  
  10. return this.afs.collection("events").snapshotChanges().pipe(
  11. map(eventSnapshots => {
  12. return eventSnapshots.reduce((eventsArray: EventInterface[], eventSnapshot) => {
  13. eventsArray.push(EventImporterJSON.getEventFromJSON(<EventJSONInterface>eventSnapshot.payload.doc.data()));
  14. // Here I need the help the below line returns an Observable<Snapshots[]>
  15. this.afs.collection("events").doc(eventSnapshot.payload.doc.id).collection('activities').snapshotchanges()
  16.  
  17. return eventsArray;
  18. }, []);
  19. }),
  20. );
Add Comment
Please, Sign In to add comment