angularfire2

AngularFire upload and get download URL

此生再无相见时 提交于 2019-12-11 01:56:23
问题 I'm trying to upload to my Storage bucket and then get the downloadURL to that uploaded file right after the upload is done. This was working previously but has since stopped for some reason. My console print is just returning null. I was hoping for a solution or even a better way of doing this. Any help would be awesome! I'm using Angular 5. Here is my current method: upload(event) { this.showProgressBar = true; const randomId = Math.random().toString(36).substring(2); this.ref = this

Extract data from FirebaseListObservable to Array

喜你入骨 提交于 2019-12-11 01:53:04
问题 sorry for my english, i have this observable: this.productos = af.database.list('/productos', { query: { orderByChild: 'categoria', equalTo: this.catnombre } }); I need extract all id from here and set in a array but i dont know how, thanks. Edit: I can extract the id but I use de key, now i need extract other data, but snapshot.val, dont work. this.productos = af.database.list('/productos/', { query: { orderByChild: 'categoria', equalTo: this.catnombre }, preserveSnapshot:true }); this

angularfire2: How to make auth in angularfire2 if I have already did it in firebase

旧时模样 提交于 2019-12-11 00:48:53
问题 I did app with ionic 2 with facebook Login. It works fine. But I mix between angularfire2 and firebase and it's not correct. this is my code import { Component,ViewChild } from '@angular/core'; import { Platform,Nav, LoadingController} from 'ionic-angular'; import { StatusBar, Splashscreen } from 'ionic-native'; //import pages import { HomePage } from '../pages/home/home'; import { LoginPage } from '../pages/login/login'; import { SignupPage } from '../pages/signup/signup'; import { TabsPage

How can I sort a FirebaseListObservable list in Angularfire2 Angular2?

这一生的挚爱 提交于 2019-12-10 19:22:17
问题 I want to get all users from a Firebase realtime database and sort them by a score property. I've got this to work using the variable users: FirebaseListObservable<any[]>; but I get the errors: Type 'Observable<any[]>' is not assignable to type 'FirebaseListObservable<any[]>'. Property '_ref' is missing in type 'Observable<any[]>'. If I change the variable to users: Observable<any[]>; then the errors go away, but then I can't use the Angularfire methods like .push() and .update() . My

Firestore: How can I re-order a collection I already have a reference to?

给你一囗甜甜゛ 提交于 2019-12-10 19:04:53
问题 Is there a way to keep a reference of the same collection, but change the ordering using firestore? TLDR: This is like the functionality I'm trying to achieve: https://stackoverflow.com/a/17320018, but since my data is from firestore, I haven't quite figured out the correct way to accomplish this dynamically. Say I have a messagesService.ts which contains a collection of messages and a reference to an Observable of messages: messagesCollection: AngularFirestoreCollection<Message> messages:

Create or increment a value with Angular2/AngularFire2

孤人 提交于 2019-12-10 17:32:35
问题 I'm using Angular 2 and AngularFire 2 to interact with Firebase. In Firebase I have a tags collection. I'd like to either create or increment the number for a tag. The code I'm using looks something like this: let tagName = "angular"; let tagObs = this.af.database.object(`/tags/${tagName}`); tagObs.subscribe(function(snapshot) { let newValue = (snapshot.$value) ? (snapshot.$value + 1) : 1; this.tagObs.set(newValue); }.bind({ tagObs: tagObs )); It's not clear to me why, but this doesn't work.

Angular 2+ Firebase Authentication - Set Login State Persistence

夙愿已清 提交于 2019-12-10 16:05:17
问题 I've set up authentication using firebase for an angular app in an auth service, and I'm trying to ensure session state persistence following successful login. I've seen that firebase is supposed to have state persistence by default, but current logins in the app only last until the page is refreshed, after which login is required again, which doesn't seem right. I know that I have to use the statePersistence method, as shown in the documentation, but this doesn't make it clear as to how this

Angular2 fire listen to node changes throws an error

那年仲夏 提交于 2019-12-10 13:39:52
问题 The code below was working and it should listen for changes in a node and execute a function but now am getting an error: ncaught TypeError: Object(...) is not a function at SwitchMapSubscriber.eval [as project] (changes.js:7) So, in my angular2 component I have: private subscriptions = new Subscription(); registered: AngularFireList<any>; constructor(private _af: AngularFireDatabase){ this.registered = _af.list('/registered'); } ngOnInit() { this.subscriptions.add( this.registered

FIRESTORE (4.10.1) INTERNAL ASSERTION FAILED: AsyncQueue is already failed: The requested version (1) is less than the existing version (2)

我只是一个虾纸丫 提交于 2019-12-10 13:08:17
问题 I'm sorry for being vague, but I really don't know what to mention except that I am receiving this error! I have no idea why except that I think it has something to do with version in compatibility. Everything worked on one machine. I cloned it to another and have this error now. I'm running Angular 5 with angularfire2. Please let me know which logs, etc. would be helpful. Thanks, Wayne I am also using ngx-pwa-localStorage so it may have something to with: Chrome console error: The requested

AngularFire2 Login Logout Subscribe to Auth issue - Angular2

落爺英雄遲暮 提交于 2019-12-10 12:54:20
问题 Ok so I've been banging my head against the wall for half a day trying to resolve this, reason I haven't as of yet is due to my level of knowledge with AngularFire2 and Angular2 is somewhat beginner. I have an application, a simple login form which uses AngularFire2 connects to Facebook , retrieves the users Access Token and Facebook Id and then calls the Facebook Graph API which returns firstname, lastname, gender, email etc. As shown here: loginWithFacebook(): FirebaseListObservable<string>