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
14
votes
4 answers

Firestore: How to query a map object inside a collection of documents?

My objective: The web app (similar to Google Drive) has 2 screens. First screen is 'My Story' which displays all the story documents whom I'm the owner. Second screen is 'Shared with me' which displays all the story documents that I'm either…
Jek
  • 5,546
  • 9
  • 37
  • 67
14
votes
6 answers

How to add timestamp to every collection insert,update in Cloud Functions for firestore database

I have a firestore collection called Posts I make an insert on the client side and it works. I want to add the createdAt and updatedAt fields to every insert in my posts collection firestore using firebase functions.
13
votes
3 answers

What should I use instead of toPromise() when using await on an Observable?

This page says "toPromise has been deprecated! (RxJS 5.5+)" but I've been using it lately with AngularFire2 (when I only want one result) like this: const foo = await this.afs.doc(`docPath`).valueChanges().toPromise(); Should I not be doing this?…
Jus10
  • 14,519
  • 21
  • 52
  • 77
13
votes
11 answers

TypeError: Object(...) is not a function

working on ionic3, angularfire2 v5 TypeError: Object(...) is not a function at SwitchMapSubscriber.project (http://localhost:8100/build/vendor.js:73935:76) at SwitchMapSubscriber._next (http://localhost:8100/build/vendor.js:61778:27) at…
Biswajit
  • 978
  • 3
  • 11
  • 30
13
votes
4 answers

Function calls are not supported in decorators but 'AngularFireModule' was called

I am using Firebase as a database for my Angular 5 application. I am able to build, run, and deploy the project using ng build. However, when I build using the --prod flag, I get the following error. Using: ng build --prod I get the following…
Darren Neimke
  • 218
  • 4
  • 18
13
votes
8 answers

Angular 4, angularfire2, Metadata version mismatch

I've got the following error Metadata version mismatch for module c:/..../node_modules/angularfire2/index.d.ts, found version4, expected 3. And if I go and check in my package.json, I have angularfire2 on version 5.0.0-rc.4, and firebase on…
Robin
  • 201
  • 2
  • 6
13
votes
1 answer

Firebase How to update multiple children?

I have parent with many children like this: Parent:{ "childe1":"data", "childe2":"data", "childe3":"data", "childe4":"data", "childe5":"data" } How can I update the children [ childe1 , childe2 , childe3 ]…
13
votes
2 answers

Angular2 - Change detection not showing unless clicked

I have an component in which you can enter some search terms and it will filter the content using a *ngFor loop. The trouble is when I enter a search term I need to click the screen for the update to take effect visually. Here is the part of the…
Pete
  • 2,325
  • 3
  • 16
  • 22
13
votes
7 answers

How do I get the current user's access token in AngularFire2?

In AngularFire you were able to access the providers (e.g Google) accessToken for the authenticated user. There does not seem to be a way to access this with AngularFire2? On initial login say like this: this.af.auth.subscribe(user=> { if (user)…
Intellidroid
  • 1,053
  • 1
  • 9
  • 15
13
votes
1 answer

Three way binding in Angular 2 and Angularfire2

I am trying to three-way bind an input element to firebase database in Angular.js 2 (2.0.0-rc.4), using AngularFire 2 (2.0.0-beta.2). I have a very simple html like:
Umut Benzer
  • 3,476
  • 4
  • 36
  • 53
12
votes
1 answer

Firestore: Delete document and security rules

Description I have a problem dealing with deletion using firestore. In short, I created a security rule for posts like this: First there are some functions in the rules: service cloud.firestore { function userRoles() { return ['admin',…
12
votes
3 answers

RxJS 6 switchMap Deprecated Symbol used

I've updated from Angular 5 to Angular 6. Now I'm trying to update my code to make it compatible with RxJS 6. .pipe( map(job => job[0]), switchMap((job) => { return job ? this.bookingService.findByID(job.property.id) : Observable.empty(); …
Subhan
  • 1,544
  • 3
  • 25
  • 58
12
votes
4 answers

How do you Delete from Firebase Storage using Angularfire2

I am basically new to Angularfire2, I am trying to delete a folder from Firebase Storage when the user presses the delete button. Unfortunately, such information is not in the Angularfire2 documentation. I have basically tried to use the code…
Kelvin Muza
  • 121
  • 1
  • 5
12
votes
2 answers

Missing or insufficient permissions errors after logout

I'm using Firebase + Ionic in a project. my problem comes when loging out. I am subscribed to several onSnapshot events in some collections. I expect all subscriptions to be dismissed whenever the a user is logged out, but it is not like that, so…
12
votes
6 answers

How to include the document id in Firestore collection in Angular 5

I have this function that gets all the posts and I want to get the id of the post any idea how to get the id of the post or How to include the id when I add the document to the collection get_the_posts(){ this.Post_collection =…
George C.
  • 6,574
  • 12
  • 55
  • 80