Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curly brackets in data binding delimiters not supported #5185

Closed
andrelanger opened this issue Apr 9, 2018 · 2 comments
Closed

curly brackets in data binding delimiters not supported #5185

andrelanger opened this issue Apr 9, 2018 · 2 comments

Comments

@andrelanger
Copy link

andrelanger commented Apr 9, 2018

It seems currently not possible to access array content within a data binding expression.
Example:

<dom-module id="x-weather">
 <template>
    {{weather.main.temp}}°C, {{weather.weather[0].description}}
    <iron-ajax
     auto
     url="http://api.openweathermap.org/data/2.5/weather" 
     last-response="{{weather}}">
    </iron-ajax>
  </template>

  <!-- ... -->

</dom-module>

The example results in the following output:

20°C weather.weather[0].description

André

@andrelanger
Copy link
Author

I am not sure if it is similar and related to #3527

@TimvdLippe
Copy link
Contributor

You actually have to use .0 instead of [0]. A working example: http://jsbin.com/wogurat/edit?html,output For more info see https://www.polymer-project.org/2.0/docs/devguide/data-binding#array-binding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants