Reputation: 2909
I'm currently trying to map an array of strings I have to its corresponding object... but cannot find a way to do the map it.
I want to do something like this below (I know syntax is not correct, but trying to get my point across)
// user.connections ["1","2","3"]
<template is="dom-repeat" items="{{user.connections}}" as="connection"
map="isAppConnection" observe="app.id">
{{connection}} <!-- The actual object -->
</template>
Upvotes: 2
Views: 272
Reputation: 1540
<dom-module is="some-element">
<template is="dom-repeat" items="{{isAppConnection(user.connections)}}" as="connection">
{{connection}}
</template>
</dom-module>
<script>
Polymer({
is: "some-element",
properties: {user: Object},
isAppConnection: function(connections){
connections.map(e=>SomeObj[e])
},
})
</script>
Upvotes: 2