Issues with data binding polymer-element

94 views
Skip to first unread message

Carlos Araya

unread,
Dec 16, 2014, 9:21:17 PM12/16/14
to polym...@googlegroups.com
I'm having a weird issue when biding the result of a firebase-element query from one element to another. 

I have an element that calls firebase-element and then binds it to another components like this:

<polymer-element name="project-app-fb">
  <template>
    <firebase-element id="base" location="https://project-list.firebaseio.com/" data="{{data}}">
    </firebase-element>
    <style></style>
    <core-drawer-panel id="drawerPanel">
      <core-header-panel drawer class="tall">
        <core-toolbar>
          <h3>Menu</h3>
        </core-toolbar>
        <project-menu on-menuItem="{{menuItem}}" id="pMenu"></project-menu>
      </core-header-panel>

      <core-header-panel main class="tall">
        <core-toolbar>
          <core-icon core-drawer-toggle
                     icon="menu" 
                     alt="Menu for narrow displays">
          </core-icon>
        </core-toolbar>
        <!--
        Custom element holding project list, styles and scripts
        Source: project-list-fb.html
        -->
        <project-list-fb data="{{data}}" on-edit-project=" {{editProject}} "></project-list-fb>
      </core-header-panel>
    </core-drawer-panel>
  </template>

The content under project-list-fb does not appear at all and when I view the source of the custom element, data on project-fb-list is shown as [object Object] and the component returns an empty #document fragment. You can see the result at http://caraya.github.io/polymer-list/firebase.html

Tested with Chrome Stable, Canary, Firefox and Safari on Mac.

I'm not sure if this is a firebase-element issue, an issue with firebase being stuck returning an HTTP 101 code, the way the code is structure, a combination of both or something else. 

Any help is appreciated

Eric Bidelman

unread,
Dec 16, 2014, 9:40:50 PM12/16/14
to Carlos Araya, polymer-dev
Hi Carlos, please ask this over on Stack Overflow so the community can help out.

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 polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/e4866ecf-0f2b-4d89-aefa-2f2708681bc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aleks Totic

unread,
Dec 17, 2014, 3:10:13 PM12/17/14
to polym...@googlegroups.com
You are doing <template repeat> on an object. Templates only repeat on arrays.

Create a computed property that's Object.keys(data), and repeat on that, dereferencing data.

Aleks

ijaz786b...@gmail.com

unread,
Apr 17, 2018, 6:40:14 AM4/17/18
to Polymer
DataScience from beginner level to advanced techniques which is taught by experienced working professionals. With our DataScience Training in Chennai you’ll learn concepts in expert level with practical manner.


Reply all
Reply to author
Forward
0 new messages