Currently, I am accessing my firebase realtime database through an angular service with the following code:
readItems() {
return this.af.database.ref(`/path`)
.on('value', snap => this.callback(snap.val()));
}
The callback function is used to modify the response as needed. My challenge now is to retrieve this modified data in the component where I make the call to readItems
. Here's how I'm making that call in the component:
this.service.readItems();
I am looking for a way to detect when this process completes and get the modified response using an observable or promise along with either subscribe
or then
. Unfortunately, I am struggling to implement this and would greatly appreciate any assistance.