dimanche 25 octobre 2015

Google Polymer with firebase: timing

I'm writing a polymer app and I'm using firebase as db. I have this code to make a firebase query:

let users = document.createElement('firebase-collection');
users.location = document.createElement('iron-meta').byKey('firebaseLocation') + 'users';
console.log(users.data);

This code is run twice:

  1. In the attached method.
  2. In a method, that is called, when the user clicks a button on the website.

When the code is run from the attached method, then no output is printed and when the user clicks the button, then the correct data is loaded and logged to the console.

Why is that?




Aucun commentaire:

Enregistrer un commentaire