angularfire2

angular2firebase - multiple instances using Angular 6

☆樱花仙子☆ 提交于 2019-12-10 12:17:27
问题 I'm upgrading to Angular 6 using AngularFire2 . My app referenced 2 Firebase projects using code like this to create the database reference: public initFirebaseApp(config: FirebaseAppConfig, firebaseAppName: string) { this._db = new AngularFireDatabase(_firebaseAppFactory(config, firebaseAppName)); } This code is now broken. I get this: ERROR in src/app/services/firebase.service.ts(24,25): error TS2554: Expected 5 arguments, but got 1. Thanks! 回答1: AngularFire now support many more

Nested Angular2 ngFor Directives for Firebase Lists [duplicate]

怎甘沉沦 提交于 2019-12-10 06:20:19
问题 This question already has answers here : access key and value of object using *ngFor (17 answers) Closed 2 years ago . I want to bind the results of a Firebase query to my template using ngFor in Angular 2. This is easily achieved below. component: export class FeaturedThreadsComponent { threads: FirebaseListObservable<any[]>; qualitySubject: Subject<any>; constructor(af: AngularFire) { this.qualitySubject = new Subject(); this.threads = af.database.list('/threads', { query: { orderByChild:

Firebase Realtime Database currently gives TRIGGER_PAYLOAD_TOO_LARGE error

荒凉一梦 提交于 2019-12-10 02:09:44
问题 Since this morning, our Firebase application has a problem when writing data to the Realtime Database instance. Even the simplest task, such as adding one key-value pair to an object triggers Error: TRIGGER_PAYLOAD_TOO_LARGE: This request would cause a function payload exceeding the maximum size allowed. It is especially strange since nothing in our code or database has changed for more than 24 hours. Even something as simple as Database.ref('environments/' + envkey).child('orders/' +

Angularfire firestore queries incredibly slow in Internet Explorer and Microsoft Edge

假装没事ソ 提交于 2019-12-09 23:58:16
问题 I have an Angular web app that uses Firestore for data. In Chrome, Firefox and Safari everything is working as expected. I've opened the app on Microsoft Edge and it's taking up to 30 seconds to fetch a collection of 4 items. Once the page loads and I click on an item to go into a 'detail' view, the load time is also just as long. Each item in a collection only has an image, title, date and reference string. The detail page has the same data and another 4 pieces of metadata, all of which are

AngularFireDatabase Does not retrieve data

纵饮孤独 提交于 2019-12-09 22:58:28
问题 Whenever I use afDB.list('/path') method, I get the following: console.log(this.items); and I have this example as my firebase database: listings file surprisingly, editing the data works perfectly fine (e.g. remove(), push(),... etc.), but I can't seem to be able to retrieve it; however, I can access it. I thought it might be a rules issue, yet, my rules are fine: firebase Rules this is the portion of the code that I'm having trouble with: import { Component } from '@angular/core'; import {

How to move FirebaseObjectObservable into a FirebaseListObservable

核能气质少年 提交于 2019-12-09 19:30:54
问题 I'm having trouble moving a FirebaseObjectObservable into a FirebaseListObservable. constructor( af: AngularFire, private cs: ContactsService, public modalCtrl: ModalController ) { // Getting Friends this.friends = af.database.list('/userFriends/jvi1cjPwddPomjEDNwv3VihskOX2/') .map((friends)=>{ return friends.map((friend) => { friend = af.database.object('/users/'+friend.$key); return friend; }) }); } When I log it to the console. I end up with an array of FirebaseObjectObservables. How can I

Firebase How to update multiple children?

与世无争的帅哥 提交于 2019-12-09 11:57:50
问题 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 ] at same time, preventing any other user from updating them at same time? 回答1: To update multiple properties at the same time, you can run an update() call: ref.child("Parent").update({ childe1: "newdata", childe2: "newdata", childe3: "newdata" }); You can even specify paths as the keys, in

AngularFire2 Authentication Error: First argument “email” must be a valid string

前提是你 提交于 2019-12-09 08:35:38
I am trying to make login and signup forms for my web app using angularFire2 and Firebase. I am getting an error when taking a users signup information and passing it into the signInWithEmailAndPassword function. signInWithEmailAndPassword failed: First argument "email" must be a valid string. I have everything in my component that deals with the email variable typed as a string and it logs to the console as a string so I am not sure exactly what is going on. I have researched for almost 3 hours now and cant find anything that could fix the issue. Template: <form action="" class="login">

AngularFIRE Property 'subscribe' does not exist on type 'AngularFireList<{}>'

放肆的年华 提交于 2019-12-09 05:47:07
问题 I'm following this tutorial about how to connect angular with firebase database. But in minute 17:30 I'm getting this error: Property 'subscribe' does not exist on type 'AngularFireList<{}>' my AppComponent: import { Component } from '@angular/core'; import {AngularFireDatabase, AngularFireDatabaseModule} from 'angularfire2/database'; import {AngularFireAuth, AngularFireAuthModule} from 'angularfire2/auth'; import { Observable } from 'rxjs/Observable'; import * as firebase from 'firebase/app'

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

烈酒焚心 提交于 2019-12-09 05:32:44
问题 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) { console.log(user.google); } }); It will log out the idToken, accessToken, provider, But (on a page refresh) subsequently will log out the standard details (uid, displayName etc....) And the accessToken is not an accessible property? Is there a way