Reputation: 8111
I would like to pass an array literal to a computed binding in polymer. My attempt looks like this:
if="[[ !isMatch(item.Type, ['Inbox', 'Review', 'Invalid']) ]]"
However, isMatch
never gets hit. Passing a single string works fine. The docs mention string and number literals will work but nothing about arrays.
Is there a syntax that will allow me to do this, or is the current solution just a series of nested if
s? Hoping to avoid the latter since it would be less performant.
Upvotes: 1
Views: 163
Reputation: 8111
Suggestion from Tomasz seems like a good option. I added the array in my polymer properties section, then used it in my conditional.
In Polymer properties
umoveableCategories: {
type: Array,
readOnly: true,
value: ['Inbox', 'Review', 'Invalid']
}
The updated conditional
if="[[ !isMatch(item.Type, umoveableCategories) ]]"
Upvotes: 1