-
Notifications
You must be signed in to change notification settings - Fork 495
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
how to request remote data for category? #143
Comments
Yea what @spyhole said, just remove the hardcoded array, take out categories: {
type: Array,
readOnly: true,
notify: true
}, then add a constructor with: constructor() {
super();
fetch('path/data.json').then(data => data.json()).then(json => {
this._setCategories(json);
});
} |
Im looking to a similar issue, is it possible to fetch the data from firebase real time database? any guidelines? |
Can you please help me by pointing out how would you implement pagination? I couldn't find examples with Polymer. |
@fabiopalumbo I'm not sure about how the shop would react to real time data changes, but for a simple static parody of the constructor() {
super();
firebase.database().ref('/shop-data/').once('value').then(snapshot => {
this._setCategories(snapshot.val());
});
} |
As far as I know, the Shop app is not supposed to be used in production. It's seems to be just a demo case of the usage of Polymer. |
reply #143 (comment) |
If it takes too long to get the categories, crash error
this.categories is undefined |
In shop-category-data.html, there is a hard coded categoryList, is is possible to use http get to prepare this data?
The text was updated successfully, but these errors were encountered: