-
Notifications
You must be signed in to change notification settings - Fork 22
Please add firebase-list #29
Comments
Been playing around with this... discovered that to build on |
I think we should use a mixin approach for some basic/generic functionality to connect to the database which can be used across various firebase components. http://pascalprecht.github.io/2014/07/14/inheritance-and-composition-with-polymer/ Got <link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../firebase-element/firebase-element.html">
<script src="firebase-as-array.js"></script>
<polymer-element name="firebase-list" attributes="list" extends="firebase-element">
<script>
(function () {
'use strict';
Polymer({
refChanged: function() {
this.list = Firebase.getAsArray(this.ref);
}
});
})();
</script>
</polymer-element> To display the list of dinosaurs iterating a list <body unresolved>
<h1>Hello World</h1>
<template is="auto-binding">
<firebase-list location="https://owjo5nyx9dj.firebaseio-demo.com" list="{{list}}"></firebase-list>
<h1>List</h1>
{{list}}
<template repeat="{{item in list}}">
<li>{{item.name}}</li>
</template>
</body> Also works like this <firebase-element location="https://owjo5nyx9dj.firebaseio-demo.com" ref="{{ref}}"/>
...
<firebase-list ref="{{ref}}" list="{{list}}"></firebase-list> |
+1. This would be very useful! Could use this with core-list as well as template repeat. |
I got it working locally and pushed my latest changes for PR. Try it out ;) |
You can try it out with this app... just needs to use firebase-list instead. https://github.com/kristianmandrup/qa-firebase-app From: https://divshot.com/blog/web-components/building-a-qa-system-with-polymer-and-firebase |
See #38 for my take on lists. |
nice! |
@lucasfanning @kristianmandrup my proposal was rejected for additional maintenance burden, so |
Should include an element that wraps this one https://github.com/katowulf/Firebase.getAsArray
Then we could avoid the keys hack and do filtering etc. directly in the template repeat :)
The text was updated successfully, but these errors were encountered: