Reputation: 117
In Polymer 1.0, is it possible to do:
{{ object in house.animals }}
where house.animals
is a list? In the documentation, I found only simple examples in the binding, like {{ animals }}
.
Upvotes: 0
Views: 29
Reputation: 138686
It looks like you're trying to change the name of the iterator to "object", which can be done by setting the <dom-repeat>.as
property (i.e., as="object"
).
And yes, you can bind <dom-repeat>.items
to a subproperty of an object as long as the subproperty is an Array
.
<template is="dom-repeat" items="{{house.animals}}" as="{{object}}">
<div>Type: {{object.type}}</div>
</template>
Upvotes: 2