3

orderByChild is not documented but is part of the public api of the query element from polymerfire.

I have something like this in my app:

<firebase-query
  id="query"
  orderByChild="[[order]]"
  path="/records/[[user.uid]]"
  data="{{records}}">
</firebase-query>

where order is property of my element that has a valid string.

The query is running and returning results, but without the sorting.

From inspecting it in chrome, the problem is that query.orderByChild is not being bound. If I assign it from the chrome console (query.orderByChild = myelement.order) it re-runs the query and return the records in the correct order.

Any idea what could be the problem?

pomber
  • 23,132
  • 10
  • 81
  • 94

1 Answers1

7

You need to dasherize your property:

<firebase-query id="query" order-by-child="[[order]]"></firebase-query>

Any time you see camel case in Polymer property definitions, you should convert to dash case when actually writing the element.

Michael Bleigh
  • 25,334
  • 2
  • 79
  • 85