angularfire2

/angularfire2/index has no exported member 'AngularFire'

£可爱£侵袭症+ 提交于 2019-11-28 09:12:33
Can't fix this problem: app.component.ts import { AngularFire, AuthProviders, AuthMethods } from 'angularfire2'; /angularfire2/index has no exported member 'AngularFire', /angularfire2/index has no exported member 'AuthProviders', /angularfire2/index has no exported member 'AuthMethods ' but in app.module.ts import { AngularFireModule } from 'angularfire2'; works fine and I can initialize the app package.json "angularfire2": "^4.0.0-rc.0", "core-js": "^2.4.1", "firebase": "^3.9.0", ... "devDependencies": {... "ts-node": "~2.0.0", "tslint": "~4.5.0", "typescript": "~2.2.0" Since you are using

NullInjectorError: No provider for AngularFirestore

大城市里の小女人 提交于 2019-11-28 06:07:36
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 serve I am getting the below error in browser console.. StaticInjectorError[AngularFirestore]: StaticInjectorError[AngularFirestore]: NullInjectorError: No provider for AngularFirestore! at _NullInjector.get (core.js:923) at resolveToken (core.js:1211) at tryResolveToken (core.js:1153) at StaticInjector.get (core.js:1024) at resolveToken (core.js:1211

Unit Testing a Service That Uses AngularFireAuth and Mocking authState

我是研究僧i 提交于 2019-11-28 01:28:36
I have been going round in circles trying to unit test a Service ( AuthService ) that depends upon AngularFireAuth . I am trying to find a way to mock, or highjack the Observable AngularFireAuth.authState instead of the Service actually talking to Firebase. Here is my test spec: import { inject, TestBed } from '@angular/core/testing'; import { AngularFireModule } from 'angularfire2'; import { AngularFireAuth, AngularFireAuthModule } from 'angularfire2/auth'; import * as firebase from 'firebase/app'; import 'rxjs/add/observable/of'; // import { BehaviorSubject } from 'rxjs/BehaviorSubject';

AngularFire2: Realtime Database: how to get key and value

随声附和 提交于 2019-11-27 21:50:57
问题 I use AngularFire2 to get data from Firebase Database (realtime). What I have done: Firebase Database { “class” : { “student” : { “Tom” : “male”, “Mary” : “female”, “Peter” : “male”, “Laura” : “female” }, "numberOfStudent” : 10 } } app.component.ts import { AngularFireDatabase } from 'angularfire2/database'; import { Observable } from 'rxjs/Observable'; ... export class AppComponent { class: Observable<any>; students: Observable<any[]>; constructor(private db: AngularFireDatabase) { this

How do you insert a “reference” value into firestore?

匆匆过客 提交于 2019-11-27 16:26:46
问题 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 programmatically insert a reference typed value? It's definitely possible to do it in the UI: 回答1: Probably the simplest solution is to set the value of a reference key to a doc(collection/doc_key) . Example code: post = { conetnet: "content...", title:

Firestore how to get the collection value from another collection document id is referenced

為{幸葍}努か 提交于 2019-11-27 14:31:19
I have two fire store collection with following reference image . I want to get the firstName and title . Here signup_id is referenced from coll-signup document id. Following code given below what i did. Model feed.ts export interface Feed { firstName? : string; signup_id? : string; title? : string; } news feed.component template <ul *ngFor="let feed of feeds"> <!-- <li>{{feed.firstName}}</li> --> // Here I want to print my first name <li>{{feed.title}}</li> <li>{{feed.signup_id}}</li> </ul> news-feed.component.ts import { Component, OnInit } from '@angular/core'; import { Feed } from '../..

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

半腔热情 提交于 2019-11-27 14:24:42
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-types/private'. It's a known issue that it's a problem with the newest npm firebase package (v4.8.1).

TypeError: Object(…) is not a function

落爺英雄遲暮 提交于 2019-11-27 13:18:27
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 SwitchMapSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:20750:18) at RefCountSubscriber.Subscriber._next (http://localhost:8100/build/vendor.js:20786:26) at RefCountSubscriber.Subscriber.next (http://localhost:8100/build/vendor.js:20750:18) at Subject.next (http://localhost:8100/build/vendor.js:23237:25) at ConnectableSubscriber.Subscriber.

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

给你一囗甜甜゛ 提交于 2019-11-27 12:38:00
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 { MoviesService } from './movies.service'; @Component({ selector: 'app-movies', templateUrl: './movies

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

天大地大妈咪最大 提交于 2019-11-27 10:53:31
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 => this.image = url); } } and I get the following error in the browser console: EXCEPTION: Error: