I'm using the firebase/polymerfire package from bower bower install firebase/polymerfire
how can i create some data in the database after a method has been triggered?
The document tag looks like it will display and update data. I would like to, when a user signs up, create some data for the user to use.
app.signInAnonymously = function() {
this.error = null;
this.$.auth.signInAnonymously();
// add default data for the user template
};
How can i use the default set() or push methods like the normal SDK?
How can i call this on an event from JavaScript?
When trying to bind a path to my document like
<firebase-document
path="/"
data="{{firebaseData}}">
</firebase-document>
{{firebaseData}}
the data won't display, but I have authentication working.
You can actually use the firebase api directly there since
firebase-auth
is already including it, but if you want to keep the element-based functionality you could do this:Add an empty
firebase-document
to yourtemplate
Then call its
save
function in your elementAs for getting data with
firebase-document
, check that you actually have data in your database and your security rules, if you still can't see your data then it might be related to this issue, do bear in mind thatpolymerfire
is still in a pre-release state