Questions tagged [angularfire5]

104 questions
2
votes
1 answer

How to get the particular document id? AngularFire 5.1.1 | Cloud Firestore | Documents

constructor(private afs: AngularFirestore) { this.itemDoc = afs.doc('items/id'); this.item = this.itemDoc.valueChanges(); } Now, this.item has the value of a particular document except id of the document. I want id and document…
Dinesh Kannan
  • 135
  • 1
  • 1
  • 7
2
votes
1 answer

Can not have access to multiple Google Firestore DB in Angular 6 application with angularfire2

I try to have access to multiple Google Firestore DB from my Angular 6 application through angularfire2 package. I initialized multiple instance of AngularFireModule in app.module.ts but couldn't find a way to have access to both DBs: …
Farhad
  • 533
  • 9
  • 21
2
votes
0 answers

angularfire getting constant value from firebase

getting values from firebase through subscription is the option we generally follow, but suppose i have some constant value saved in firebase database, and i want to read that value on invoke of my function how can i get the value without…
2
votes
1 answer

How to get UID from an Angular fire store Document without snapshot

let say I have a collection named Countries and a doc looks like below { name: "Pakistan" //other field removed to focus on problem only } and a Collection names Cities which doc have above country field reference looks like { name:…
Abdul Hameed
  • 1,008
  • 1
  • 15
  • 35
2
votes
0 answers

Filtering data with Firebase (firestore) and Angular 5

I am struggling to find good material on best practices for filtering data using firebase firestore, angularfire5 and angular 5. I am building a map based web app, similar to a real estate app. And I have pins on the map that need to be filtered by…
2
votes
0 answers

Angularfire2 v5 avoid reload all data when using async pipe

I have db structure like this cart: yyy: productId: aaa count: 2 zzz: productId: bbb count: 1 product: aaa: name: AAA bbb: name: BBB I join them and getting and listing data by below code cart.ts cartRef:…
2
votes
1 answer

Angularfire2 how to combine two list

I am using Angularfire2 v5. In my database I have two lists one is cartand other one is product. In cart list there is a field which contains product id and now I want a Observable that contains data for both the cart and it's product. Currently I…
2
votes
1 answer

AngularFire check if value exists, if not, create it

I am new on AngularFire, and after the update to AngularFire5 I am having some issues. I want to create a 'room', the one which will have a id:name, so after the user inputs the name, I've check on the database if this name exists, if not, I will…
2
votes
2 answers

AngularFire 5: list().valueChanges() does not return anything to subscribe

I'm going to retrieve a list from Firebase using the following code in an Ionic component: this.afDB.list ( '/my-data/key1/data' ).valueChanges().subscribe ( res => console.log (res), error => console.log (error), () => console.log ("complete")…
David
  • 21
  • 1
  • 2
1
vote
1 answer

Querying data from Firestore as observable

I am using this request to get my documents from Firestore asynchronously. During an operation (delete for example) the list of my documents is not updated automatically. How can I transform my asynchronous function into an observable in order to…
1
vote
2 answers

Angular Fire fetching related data from same collection

I´m facing a strange behavior with a query on my firestore project. One user of the project is like the owner of the system, we call him the producer. And the other users, can belong to one producer, so I have a collection of users, where I have a…
1
vote
1 answer

Using .groupBy with Firestore collection data

I have a Firestore collection with a number of jobs but I want to group them by the job number on the client side. I have gone through a lot of examples online like this.jobs = this.afs.collection('jobs').valueChanges().pipe(groupBy((job: any) =>…
Xerri
  • 4,916
  • 6
  • 45
  • 54
1
vote
0 answers

No provider for AngularFirestore when i import AngularFirestoreModule and AngularFireModule inside lazyloaded module

When I import AngularFireModule and AngularFirestoreModule inside root module of my angular application everything works fine.But don;t want to import them in my root module to keep my root module bundle small.So I import them inside lazy loaded…
jay pat
  • 41
  • 1
1
vote
1 answer

AngularFire storage task observable never completes

I am uploading a camera gallery image to firebase successfully, however I am unable to getDownloadURL() as the AngularFire storage task observable never completes. I have consulted the documentation following the 'Monitoring upload percentage' -…
altergothen
  • 425
  • 1
  • 7
  • 12
1
vote
1 answer

AngularFire - Push data from firestore collection query into an array

I'm querying a Firestore collection an successfully retrieving the results. However, I'm using a sortable angular plugin that requires an array to sort. The issue I have is that the items are being pushed into the array, but I cannot find a correct…
Que
  • 957
  • 2
  • 14
  • 35