angularfire2

Cannot find module '@firebase/app-types/private' - Firebase throws error

蓝咒 提交于 2019-11-26 16:45:54
问题 I am working on application using angular and firebase. I installed firebase with the instructions given on site and the versions as follows, "angularfire2": "^5.0.0-rc.4", "firebase": "^4.8.1", but the following error comes ERROR in node_modules/@firebase/database/dist/esm/src/api/Database.d.ts(4,33): error TS2307: Cannot find module '@firebase/app-types/private'. node_modules/@firebase/database/dist/esm/src/core/AuthTokenProvider.d.ts(17,39): error TS2307: Cannot find module '@firebase/app

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

╄→гoц情女王★ 提交于 2019-11-26 16:04:59
问题 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 { AngularFireDatabase } from 'angularfire2/database'; @Injectable() export class MoviesService { constructor(private db: AngularFireDatabase) {} get = () => this.db.list('/movies'); } There is my component: import { Component, OnInit } from '@angular/core'; import

Accessing firebase.storage() with AngularFire2 (Angular2 rc.5)

a 夏天 提交于 2019-11-26 15:21:28
问题 I am trying to access firebase.storage() on my project, with: "@angular": "2.0.0-rc.5" "angularfire2": "^2.0.0-beta.3-pre2" "firebase": "^3.3.0" I found this solution, and created my .component.ts file with: import { Component } from '@angular/core'; declare var firebase : any; @Component({ template: '<img [src]="image">' }) export class RecipesComponent { image: string; constructor() { const storageRef = firebase.storage().ref().child('images/image.png'); storageRef.getDownloadURL().then(url

How to get do a join in angularfire2 database

北城余情 提交于 2019-11-26 14:25:22
问题 I have searched through and I still couldn't get the right answer. I will be happy you point me to the right direction. I have a database with users and projects pojects: 08177a0acb3f4d96f8cb5fa19002d2ed: pid: 08177a0acb3f4d96f8cb5fa19002d2ed, pName: "Prject 1" uId: "254", createdAt: 9377476 users: 254: userName: "Eric" uId: "254" avatar: "image.jpg" Now I want to display my projects, I do a list retrieve in my service this.projectList = this.af.database.list('projects', { query: {

Joining Flattened Data

◇◆丶佛笑我妖孽 提交于 2019-11-26 11:22:12
问题 i\'d like to join the data on init from my customers table into the projects list. Model is like this: projects key name: string customer : customerKey customers key name: string Do you have an example, how i do this from angular2 component using angularfire2? my controller looks like this: import { Component, OnInit } from \'@angular/core\'; import { Project } from \'../project\'; import { Router } from \'@angular/router\'; import { FirebaseAuth } from \'angularfire2\'; import { AngularFire,

Firestore slow performance issue on getting data

◇◆丶佛笑我妖孽 提交于 2019-11-26 08:49:38
问题 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’) .doc(‘testDoc’) .valueChanges().forEach((data) => { console.log(data);//3000 ms later }); Using the realtime database, it takes an average of 300 ms on the first call this.db.database.ref(‘/test’).once(‘value’).then(data => { console.log(data); /

“ERROR TypeError: Object(…) is not a function” using AngularFirestore and firebase

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-26 06:07:11
问题 I want to use firebase and angularfire2 in my app, first of all, I installed them, and for the declarations: in environment.ts export const environment = { production: false, firebase: { apiKey: \'sfsdfdsff\', authDomain: \'sfsdfdf\', databaseURL: \'https://ng-sfsdfsf.firebaseio.com\', projectId: \'ng-fitnesssfsdfdsf\', storageBucket: \'ng-fsdfsdfsfdecff5.appspot.com\', messagingSenderId: \'21331323\' } }; in app.module.ts, imports: AngularFireModule.initializeApp(environment.firebase),

Many to Many relationship in Firebase

混江龙づ霸主 提交于 2019-11-25 23:13:09
问题 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 about Companies and Contractors: Given a Company, who are the current Contractors. Given a Contractor what Companies are they working for. What are the alternatives for structuring the data within firebase? 回答1: The self-answer is indeed one way

Firebase query if child of child contains a value

独自空忆成欢 提交于 2019-11-25 22:52:35
问题 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 username string. Here is what I have so far: subscribeChats(username: string) { return this.af.database.list(\'chats\', { query: { orderByChild: \'participants\', equalTo: username, // How to check if participants contain username } }); } 回答1: Your