-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[0.8] Feature request: computed properties in x-repeat #1337
Comments
+1 |
+1 Is there a workaround yet? ps: Issue #1337 :) |
👍 Needed here too +1 @robdodson - do you know a workaround? |
@kevinpschaaf and @sorvell are the Polymer core wizards who might know secret black magic workarounds ✨ |
There are no good workarounds right now. This will definitely be done before 1.0, hopefully in 0.9 timeframe. |
why can't you use filter? <core-icon icon="[[item.type | computeIconFromType]]" [[computeIconFromType(item.type)]]
|
Does this not work either?
in an |
As an alternative (or in addition), what about a <template is="x-repeat" map="prepareRepeat" items="[[users]]">
<a href="[[item.profileLink]]">[[item.name]]</a>
</template>
<script>
Polymer({
prepareRepeat: function(user) {
return {
name: user.name,
profileLink: "/users/" + user.id
}
}
})
</script> |
I would like to use computed properties based on array data used in an
x-repeat
. For example, given data like this:I want to be able to do:
The text was updated successfully, but these errors were encountered: