Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular + Firebase: How to quickly load lots of data?

I’m using AngularJS and Firebase.

Goal: I want to display all the data that’s in my Firebase (fixed number of items: ~1600).

Problem: It takes about 10 seconds until AngularFire calls "loaded". The data is about 120 kb and I feel that this could be faster. (e.g. loading the dataset from a .json file takes a second or so).

Is there a way to speed this up?

like image 971
Florian Schulz Avatar asked Nov 02 '22 04:11

Florian Schulz


1 Answers

If you don't need to listen for updates to the data, you could use the REST API and just do a $http.get() request to the firebase reference + .json:

$http.get('https://dinosaur-facts.firebaseio.com/dinosaurs.json')
.success(function(dinos) {
    console.log('The dinosaurs are coming!', dinos);
});

Not sure how much quicker it will be with lots of data, but might be worth a try.

like image 151
bmc Avatar answered Nov 11 '22 13:11

bmc