firebase-element
firebase-element copied to clipboard
Uncaught TypeError: Cannot read property '__firebaseKey__' of undefined
I have a collection of objects in a firebase db
<template>
<firebase-collection
location="https://incandescent-inferno-8405.firebaseio.com/objects/-JubQT-WrBaVlSeuKJhO"
data="{{object}}"
</firebase-collection>
<paper-input value="{{object.attribute::input}}"></paper-input>
</template>
When I start typing in the input field I get
Uncaught TypeError: Cannot read property '__firebaseKey__' of undefined
Is this a bug or am I doing something wrong?
Hi, this is a symptom of a bug that was addressed a few days ago. Can you confirm that you have the latest version of the element (v1.0.2)? Thanks!
I updated to the latest version but still got the same error. However this works
<firebase-collection
location="https://incandescent-inferno-8405.firebaseio.com/objects"
data="{{objects}}"></firebase-collection>
<template is="dom-repeat" items="{{objects}}" as="object">
<paper-input value="{{object.attribute}}"></paper-input>
</template>
Thanks for the examples. I will take a look.
@jenyckee I believe it's as I answered here - http://stackoverflow.com/questions/31504447/firebase-polymer-two-way-binding-uncaught-typeerror-cannot-read-property-f/31545356#31545356 You are mixing up collections & documents/arrays of objects & single objects. In your first example above you are trying to bind your collection of objects to a single paper-input, doesn't work/make sense. In the 2nd example you are binding a single object from your collection to a single paper-input value, that does make sense & works.