Questions tagged [angularfire2]

AngularFire is the officially supported Angular binding for Firebase. The combination of Angular and Firebase provides a three-way data binding between your HTML, your JavaScript, and the Firebase database. This tag is for binding with Angular2+. Don't use this tag for binding with AngularJS.

AngularFire2 is the officially supported Angular2+ binding library for Firebase. The combination of Angular2 and Firebase provides a three-way data binding between your views, components and the Firebase database. There are Firebase auth features available besides the database.

3107 questions
210
votes
12 answers

NullInjectorError: No provider for AngularFirestore

I'm learning Angular looking for help in fixing the error: I'm following this link : https://github.com/angular/angularfire2/blob/master/docs/install-and-setup.md to create a angular small app with angular2 and angularfirestore2 but when I hit ng…
Developer
  • 2,389
  • 4
  • 11
  • 17
85
votes
5 answers

Firestore slow performance issue on getting data

I'm having slow performance issues with Firestore while retrieving basic data stored in a document compared to the realtime database with 1/10 ratio. Using Firestore, it takes an average of 3000 ms on the first call this.db.collection(‘testCol’) …
80
votes
1 answer

Firebase query if child of child contains a value

The structure of the table is: chats --> randomId -->--> participants -->-->--> 0: 'name1' -->-->--> 1: 'name2' -->--> chatItems etc What I am trying to do is query the chats table to find all the chats that hold a participant by a passed in…
75
votes
10 answers

Firestore Getting documents id from collection

I'm trying to retrieve my documents with id but can't figure it out. Currently I retrieve my documents like this : const racesCollection: AngularFirestoreCollection = this.afs.collection('races'); return racesCollection.valueChanges(); I do…
Élyse
  • 1,351
  • 1
  • 10
  • 12
58
votes
7 answers

Angular 4: InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'

i need your help, i'm trying to display some datas from my firebase but it trhows me an error like InvalidPipeArgument: '[object Object]' for pipe 'AsyncPipe'. There is my service: import { Injectable } from '@angular/core'; import {…
P_Js
  • 593
  • 1
  • 5
  • 7
52
votes
5 answers

How do you insert a "reference" value into firestore?

I'm trying to insert a document into a collection. I want the document to have a attribute of type reference to insert into the collection. But every time I insert into the collection, it comes out as a string or an object. How can I…
AskYous
  • 4,332
  • 9
  • 46
  • 82
50
votes
2 answers

Why does this firestore query require an index?

I have a query with a where() method with an equality operator and then an orderBy() method and I can't figure out why it requires an index. The where method checks for a value in an object (a map) and the order by is with a number. The…
tokism
  • 637
  • 1
  • 5
  • 10
49
votes
1 answer

'await' expression is only allowed within an async function

I have an async method like below. It shows an error [ts] 'await' expression is only allowed within an async function. here await userProfile.set({. Can you tell me how to sort out it? Note: Maybe it is due to I have tried to call promise inside the…
Sampath
  • 63,341
  • 64
  • 307
  • 441
46
votes
2 answers

Use case of Observable .do() operator (rxjs)

 Context : I'm building an angular 2 app (with a Firebase API). I'm using the AngularFire module. I was wondering how I can mix the canActivate method with the AngularFire auth Observable, and I found this post. The answer is to make the canActivate…
soywod
  • 4,377
  • 3
  • 26
  • 47
44
votes
2 answers

Many to Many relationship in Firebase

I have a Firebase database. I have Companies and Contractors. A Contractor can work for more than one Company and a Company can have multiple Contractors. This is a straightforward many to many relationship. I want to be able to answer the questions…
Rob Gorman
  • 3,502
  • 5
  • 28
  • 45
39
votes
7 answers

What's the best way to check if a Firestore record exists if its path is known?

Given a given Firestore path what's the easiest and most elegant way to check if that record exists or not short of creating a document observable and subscribing to it?
David Haddad
  • 3,796
  • 8
  • 32
  • 40
36
votes
7 answers

Leaderboard ranking with Firebase

I have project that I need to display a leaderboard of the top 20, and if the user not in the leaderboard they will appear in the 21st place with their current ranking. Is there efficient way to this? I am using Cloud Firestore as a database. I…
34
votes
6 answers

Using Firebase emulator with AngularFire

I am trying to use the freshly introduced Firestore emulator in my Angular7 application. According to this documentation, I run the dev server on 127.0.0.1:8080 with : firebase serve --only firestore Then, after ng serve, how can I make my…
Loheek
  • 1,865
  • 17
  • 28
34
votes
6 answers

No provider for AngularFireDatabase, AngularFireAuth

Apologies as I can't think of a better way of including all the information... When I run this, I get an error saying the following. I've followed the Ionic Docs to the T, I can't figure out what could possibly be wrong. Error: No provider for…
Slabach
  • 391
  • 1
  • 4
  • 9
33
votes
5 answers

Observable.forkJoin() doesn't execute

I have the following code: //Loop: For each user ID/Role ID, get the data userMeta.forEach((businessRole) => { Observable.forkJoin( af.database.object('/roles/'+businessRole.$value), af.database.object('/users/'+businessRole.$key) …
TheUnreal
  • 23,434
  • 46
  • 157
  • 277
1
2 3
99 100