googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 56 forks source link

Indexer expressions like {{ myproperty[2] }} should work. #112

Closed krisnye closed 11 years ago

krisnye commented 11 years ago

Of course you should also be able to nest an expression inside it like this {{ myproperty[ myotherproperty * 5 ] }}

arv commented 11 years ago

Here is a test

https://github.com/arv/mdv/commit/7b4b2bea9f4334f7751bfcc8cb354c313b03e78c

rafaelw commented 11 years ago

I believe this is now fixed

kaosat-dev commented 10 years ago

I might be missing something, but it seems like this does not work in all cases : If you have an attribute like this one: objArray:[{name:"foo"},{name:"bar"}]

In a template , this works {{objArray.0.name}}

but this does not {{objArray[0].name}} (throws error : Invalid expression syntax: objArray[0].name)

I also whipped up a jsbin for clarity: http://jsbin.com/iFUlEBAp/2/edit?html,output

rafaelw commented 10 years ago

Good catch, @kaosat-dev Fixed here: https://github.com/Polymer/polymer-expressions/commit/fd80253