googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 61 forks source link

Accessing array elements doesn't work within an expression using ExpressionSyntax #122

Closed sorvell closed 10 years ago

sorvell commented 11 years ago

This works:

{{ someArray.0 }}

Accessing array items is convenient (e.g. I want to display the first video in a prioritized list of video data).

Accessing an array element within an expression does not work:

{{ someArray.length > 0 ? someArray.1 : 'none' }}

Here's an example: http://jsbin.com/agacet/1/edit

jmesserly commented 11 years ago

I wonder if the bracket syntax works?

{{ someArray.length > 0 ? someArray[1] : 'none' }}

That seems a little more intuitive, IMHO.

FYI to @justinfagnani

arv commented 11 years ago

array[index] is tracked at https://github.com/Polymer/mdv/issues/112

rafaelw commented 10 years ago

issue was 112 is fixed