aurelia / templating-binding

An implementation of the templating engine's Binding Language abstraction which uses a pluggable command syntax.
MIT License
32 stars 26 forks source link

Binding to the presence of an item in a collection #86

Closed heruan closed 8 years ago

heruan commented 8 years ago

Is it possibile to bind to the presence of an item in a collection, like Set, Map or Array?

For example, say we have set1 and set2:

<li repeat.for="item of set1">
    ${item.value} <span if.bind="set2.has(item)">(present in set2)</span>
</li>

I tried this but it doesn't update when set2 changes.

jdanyow commented 8 years ago

Would this work for you? https://gist.run/?id=61b94e889c95d4336de7

@EisenbergEffect thoughts?

EisenbergEffect commented 8 years ago

Clever.

jdanyow commented 8 years ago

@heruan can this be closed?