How to upload to Firebase Storage using Angular 2 - #AskFirebase
Why Stack Overflow recommends it
Stack Overflow users link it mainly for the 4:40 segment on sorting Firebase data newest-first, and also as a reference for using the Firebase JS library with AngularFire2.
Recommended by 1 people across 1 different months, 2016 to 2017.
What it is
An episode of the Firebase team's #AskFirebase series from 2016 in which presenters answer viewer questions. Topics include Dynamic Links, Realtime Database listener scope, sorting queries by date descending, uploading to Storage with AngularFire2, and custom token login in Node.js.
What people said
Recommends Srujan Barai · 2017-01 · Stack Overflow · on “Correctly sort nodes from newest to oldest”
What you have done is absolutely correct. The only difference is, you should have both, a timestamp and a negativeTimestamp key just in case you need either of them. It all depends on your requirements anyways. In-fact people from firebase suggest the same. You can watch this youtube video [this video] and move to 04:40 to see the answer to your question from the firebase team themselves.
Cites Willjay · 2016-08 · Stack Overflow · on “Firebase queryOrderedByChild() method not giving sorted data”
Use method observeEventType instead of observeSingleEventOfType . Also, make FIRDataEventType to ChildAdded . Last, If you want Top 20 items, use queryLimitedToFirst instead of queryLimitedToLast . { "users" : { "alovelace" : { "name" : "Ada Lovelace", "score" : 4 }, "eclarke" : { "name" : "Emily Clarke", "score" : 5 }, "ghopper" : { "name" : "Grace Hopper", "score" : 2 } } } For the dataset above let queryRef = FIRDatabase.database().reference().child("users").queryOrderedByChild("score").queryLimitedToFirst(20) queryRef.observeEventType(.ChildAdded, withBlock: { (snapshot) in print("key: \(snapshot.key), value: \(snapshot.value)") }) key: ghopper, value: Optional({ name = Grace Hopper; sco
Cites Капылов Данил · 2016-08 · Stack Overflow · on “Firebase - Structuring Data For Efficient Indexing”
As I understand the principle firebase to use it effectively. Should be as small as possible to query the data and it does not matter how many requests. But you will approach such a request. We'll have to add another field to the database "negativeDate". This field allows you to get the last seven entries. Here's a video - [this video] [LINK] .limitToLast(7) - 7 entries .orderByChild('negativeDate') - sort by date Example of a request: const ref = firebase.database().ref('maxBenchPressSession'); ref.orderByChild('negativeDate').limitToLast(7).on('value', function(snap){ })
Cites Dave Fisher · 2017-05 · Stack Overflow · on “Using "firebase" with AngularFire2 v4”
I use angularfire2 for my Angular web apps and I recently upgraded to the v4.0.0-rc0. It behaves different in a few ways. The thing I need help with is using 'firebase' (the regular Firebase JS library) along side angularfire2 in the v4.0.0 version. In previous versions you would import: import * as firebase from 'firebase'; and then use the regular Firebase JS library with statements like this: firebase.database().ref().child("message").set("hi"); That worked fine in prior versions, see this video for more about that approach (it's a requirement when using storage): [this video] However when I try to do the same thing with v4.0.0-rc0 I get this error message: Firebase: No Firebase App '[DEFAULT]