I'm trying to extend the firebase-element to enable wrapping "arrays" as a 
javascript list, as per: https://github.com/katowulf/Firebase.getAsArray

I have the following element, firebase-list which extends firebase-element.

<link rel="import" href=
"../../bower_components/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({
        list: null,
        attachedCallback: function() {
          console.log(this.location);
          this.locationChanged();
          console.log(this.ref);
          this.list = Firebase.getAsArray(this.ref);
        }
      });


    })();
  </script>
</polymer-element>

My problem/question is, how do I manage setting `this.list` properly, as it 
is done async?
My index.html just renders and doesn't update the list... ah, I guess I 
have to set an observer on `_list` and then set my published list property 
when ready?

<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>


  <!-- build:js scripts/app.js -->
  <script src="scripts/app.js"></script>
  <!-- endbuild-->
</body>

Thanks or any tips on best practice for handling this. Cheers!

Follow Polymer on Google+: plus.google.com/107187849809354688692
--- 
You received this message because you are subscribed to the Google Groups 
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/6cb4f92c-271f-4229-b06b-7289c086001b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to