-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
firebase-document only works with static locations #31
Comments
Try a computed value. Polymer({
is: 'example-element',
properties: {
route: {
type: String,
value: "dinosaurs"
}
location: {
type: String,
computed: '_computeLocation(route)'
}
},
_computeLocation: function(route) {
return "https://dinosaur-facts.firebaseio.com/" + route;
}
}); This will change the location variable anytime the route variable changes. |
@sfeast actually, the code you provided appears to work for me. Are you using the latest version? |
Thanks for taking a look. Looks like it's also tied to the data property. Here's an example (only works in chrome I think since I'm defining an element in the main html doc) - https://jsbin.com/mohifu/edit The example spits out the error I mentioned but if you replace
with
then it will also start working. |
I had the same issue and i solved changing the following method in firebase-document
|
After performing a fresh clone of my project repository, I'm now receiving this issue. I was on firebase-element v1.0.10, and after the clone I'm on the latest v.1.0.12, but nothing in the change logs would seem to affect this behavior... regardless, I'm receiving the error. I'm at a loss after some debugging... the code is as follows:
The property
But, removing the value, or removing the property entirely has no effect. I've added the following logs to firebase-document:
Obviously, the last line of output is an issue. But, considering "query" is a property of The suggestion by @albertolobrano works fine, but this needs to be addressed in an official update! |
Can someone submit PR? On Thu, Feb 4, 2016, 5:02 AM Max Mueller [email protected] wrote:
|
I'd be happy to, but I'm just wondering if that fix is sufficient. Also, does the same have to be considered for firebase-collection? |
I think the title is misleading for this issue -- it's not really the location that is causing the error described in the issue, its the fact that Now, maybe that only happens when the location isn't a static string, but performing a check for existence of |
I'm not sure #109 is the best fix. From reading all the comments, this does seem like a timing issue with Something like #31 (comment) seems like a good approach. If someone can throw together a simple jsbin that uses dynamic locations that would be really helpful. There's a couple of open issues on dynamic locations not working, so we should make sure everything is covered. |
@ebidel, note about the comment that you referenced. IMO, the fix (at least, in firebase-document), should be in
|
Yea, we should add checks everywhere where methods depend on Just so I'm clear, it's not that setting a |
In many cases have I set a location dynamically through a compute or simple data binding, but in some rare instances, yes, the |
|
Guys give any idea, I am beginner of polymer and firebase |
For example something like:
with getLocation defined as:
gives the following:
Looks like an issue in _applyLocalDataChanges since it tries to update the remote doc here even when there is no data or query but not certain how to best address.
The text was updated successfully, but these errors were encountered: